tag:blogger.com,1999:blog-5562253332413822713.post222194607439148942..comments2024-02-19T10:26:36.166-08:00Comments on SQL Server Interview Questions: SQL Server Interview QuestionsUnknownnoreply@blogger.comBlogger21125tag:blogger.com,1999:blog-5562253332413822713.post-55366270963214968272018-04-20T09:30:33.802-07:002018-04-20T09:30:33.802-07:00Hello Guy, A very big regard to Mr.Vankat
All the ...Hello Guy, A very big regard to Mr.Vankat<br />All the way from African precisely Nigeria, I copied your tutorial videos on Microsoft SQL from a friend of mine.<br />It was a very good and excellent one.Your method of teaching is unique and classic. I pray that God will reward you and bless your family. Anonymoushttps://www.blogger.com/profile/04198542061875974188noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-73743818238684845732017-09-19T11:17:45.387-07:002017-09-19T11:17:45.387-07:00HOW TO RECOVER DEADLOCK TRANSACTION ID PROCESS LOC...HOW TO RECOVER DEADLOCK TRANSACTION ID PROCESS LOCKAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-64326403913863765322017-03-25T21:28:25.027-07:002017-03-25T21:28:25.027-07:00DECLARE @DOB Datetime, @tempdate Datetime, @years ...DECLARE @DOB Datetime, @tempdate Datetime, @years int, @months int, @days int<br />SET @DOB='10/08/1982'<br /><br />SELECT @tempdate = @DOB<br /><br />SELECT @years = DATEDIFF(YEAR, @tempdate, GETDATE()) -<br />CASE<br />WHEN (MONTH(@DOB) > MONTH(GETDATE()) OR <br />(MONTH(@DOB) = MONTH(GETDATE()) AND DAY(@DOB) > DAY(GETDATE())))<br />THEN 1 ELSE 0<br />END<br />SELECT @tempdate = DATEADD(YEAR, @Years, @tempdate)<br /><br />SELECT @months = DATEDIFF(MONTH, @tempdate, GETDATE())-<br />CASE<br />WHEN DAY(@DOB) > DAY(GETDATE()) <br />THEN 1 ELSE 0<br />END<br />SELECT @tempdate = DATEADD(MONTH, @months, @tempdate)<br />SELECT @days =DATEDIFF(day, @tempdate ,GETDATE())<br />SELECT @Years as Years, @months as Months ,@days as [Days]Srinuhttps://www.blogger.com/profile/01573920931124915141noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-48946116278235170862016-12-03T10:55:24.529-08:002016-12-03T10:55:24.529-08:00i think we use it in query scripts we rarely use ...i think we use it in query scripts we rarely use it and no need to save data that we want as a normal table. Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-51720421409040475692016-09-04T07:12:42.054-07:002016-09-04T07:12:42.054-07:00Both, #Table and ##Table are temporary tables. #Ta...Both, #Table and ##Table are temporary tables. #Table is only accessible to that particular user whereas ##Table is accessible to anyone who has access to that Database.Aloknoreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-28850093584026914362016-07-31T23:21:43.607-07:002016-07-31T23:21:43.607-07:00Hi Sir,
what is #table and ##table, what is the di...Hi Sir,<br />what is #table and ##table, what is the difference between them and when we use it in real time.Vickyhttps://www.blogger.com/profile/17585669019091683205noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-72399275433279033142016-01-09T12:14:14.001-08:002016-01-09T12:14:14.001-08:00Hi Venkat Sir,
I've got a query. I researched ...Hi Venkat Sir,<br />I've got a query. I researched about this but didn't get a correct answer. following is the query.<br /><br />Can it be a good practice to join all tables in the same order on all queries if at all possible ? Are the tables with switched orders between queries the most common cause of a deadlock. For example, selecting from Client table inner join Order table in one query and Order table inner join Client table in another query - if they get executed at the same time, is there a deadlock potential ? What can be a standard rule for this ? Can joining all tables in the same alphabetical order on all queries help ?<br /><br />From : Sumit, sumitofficial7777@gmail.comAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-22645743386800650692015-04-21T11:52:16.989-07:002015-04-21T11:52:16.989-07:00Hi venkat sir
how can we store videos, audios and...Hi venkat sir<br /><br />how can we store videos, audios and images in sql server 2008 and 2012SrikanthRajuhttps://www.blogger.com/profile/13439971703272079882noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-75633390001316766462014-12-29T09:24:24.010-08:002014-12-29T09:24:24.010-08:00Hi Sir,
how do i grant privileges to specific user...Hi Sir,<br />how do i grant privileges to specific user (based on role)Anonymoushttps://www.blogger.com/profile/12933181681846216852noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-9840329831689344212014-09-10T05:17:46.870-07:002014-09-10T05:17:46.870-07:00Hi,
Can you explain types of locks in SQL?Hi,<br />Can you explain types of locks in SQL?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-33389366772982489602014-08-30T12:54:02.994-07:002014-08-30T12:54:02.994-07:00Can you please explain about CTE?Can you please explain about CTE?ravihttp://google.comnoreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-11941526568635823932014-08-01T07:26:11.493-07:002014-08-01T07:26:11.493-07:00This is one of the interview questions asked to me...This is one of the interview questions asked to me?<br />How do you arrange data or what is procedure you apply to write code when a problem statement is given in 3 tier architecture?<br />Ex : Whether you will add tables,data etc in Database or Add code in Presentation layer to display in front end or Create Business objects in Business layer or Data Access Objects in DAL.. Tell me the order you follow ?<br /><br />Kindly need an answer for this<br />Pls HelpAnonymoushttps://www.blogger.com/profile/02381196405161050260noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-72803761021447795672014-03-19T10:08:04.359-07:002014-03-19T10:08:04.359-07:00Hello Sir,
Can i rename files place in folder thro...Hello Sir,<br />Can i rename files place in folder through SQL query.<br />If Yes Please just upload a code . I'll be thankful to you.<br />The Problem is following..<br />• There is a folder with 100s of pictures i.e. 834343.jpg, 843244.jpg etc<br />• I need to update all files with the corresponding ID_NUMBER of the Personnel number attached to the photos (personnel number 834343).<br />• The table aview_person has two distinct columns (extra_code_1 which holds the values of the personnel numbers (834343, 843244 and so on etc)… The table also has a column ID_Number (001.344324233232432,002.34453453453453) which is the reference ID number which is associated to the value in extra_code_1.<br />• The pictures need to be updated with the ID_number and the extension. So the update once completed should look like this<br />o Original picture (843423.jpg)<br />o New Picture (001.334323432434234243.jpg)<br />• I need the query to loop through all photos can change to the corresponding ID Number<br /><br />Query<br />DECLARE @ID_NUMBER NVARCHAR(27)<br />SELECT @ID_NUMBER = ID_NUMBER FROM aView_person WHERE EXTRA_CODE_1 ='photo name'<br /><br />---PSEUDO---<br />update<br />'Photo name in File Path where photos are stored'<br />set'photo name'= @ID_NUMBER +'.JPG'<br />innerjoin aview_person per on'name of photo (without the .jpg extension)'= per.extra_code_1<br />where per.extra_code_1 ='photo name'<br /><br /><br /><br />--Example--<br />---------Loop through all files in the folder until all files have been updated with the corresponding id_number'<br /><br />update'C:/Test/' ---photos location<br />set'834567.jpg'='001.3434312759397368038'+'.jpg'<br />innerjoin aview_person per on'834567'= per.extra_code_1<br />where per.extra_code_1 ='834567'<br /><br />I Search for the solution my best, but can't find .<br />Sir you are the only hope to help me. If it is possible then help me please.Anonymoushttps://www.blogger.com/profile/01272770133136563784noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-21822869765238946932014-02-03T17:42:34.357-08:002014-02-03T17:42:34.357-08:00DECLARE @DOB Datetime, @tempdate Datetime, @years ...DECLARE @DOB Datetime, @tempdate Datetime, @years int, @months int, @days int<br />SET @DOB='10/08/1982'<br /><br />SET @tempdate = @DOB<br /><br />Set @years = DATEDIFF(YEAR, @tempdate, GETDATE()) -<br /> CASE<br /> WHEN ((MONTH(@DOB) > MONTH(GETDATE()) OR <br /> (MONTH(@DOB) = MONTH(GETDATE())))<br /> <br /> AND (DAY(@DOB) > DAY(GETDATE())))<br /> THEN 1<br /> ELSE 0<br /> END<br /><br /><br /> <br />SELECT @tempdate = DATEADD(YEAR, @Years, @tempdate)<br /><br />SELECT @months = DATEDIFF(MONTH, @tempdate, GETDATE()) -<br /> CASE<br /> WHEN (DAY(@DOB) > DAY(GETDATE()) )<br /> THEN 1<br /> ELSE 0<br /> END<br /> <br />SELECT @tempdate = DATEADD(MONTH, @months, @tempdate)<br />SELECT @days =DATEDIFF(day, @tempdate ,GETDATE())<br />SELECT @Years as Years, @months as Months ,@days as [Days]<br /><br />Anonymoushttps://www.blogger.com/profile/10924258576166198497noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-89379734858906413762012-12-16T18:01:51.502-08:002012-12-16T18:01:51.502-08:00Hi Mr Venkat
thank you for your hard work second
i...Hi Mr Venkat<br />thank you for your hard work second<br />i would like to ask quatsion i have problem in part 27 in sql server i have this code<br /><br /><br />DECLARE @DOB Datetime, @tempdate Datetime, @years int, @months int, @days int<br />SET @DOB='10/08/1982'<br /><br />SELECT @tempdate = @DOB<br /><br />SELECT @years = DATEDIFF(YEAR, @tempdate, GETDATE()) -<br /> CASE<br /> WHEN (MONTH(@DOB) > MONTH(GETDATE()) OR <br /> (MONTH(@DOB) = MONTH(GETDATE()) AND DAY(@DOB) > DAY(GETDATE()))<br /> THEN 1 ELSE 0<br /> END<br />SELECT @tempdate = DATEADD(YEAR, @Years, @tempdate)<br /><br />SELECT @months = DATEDIFF(MONTH, @tempdate, GETDATE())<br /> CASE<br /> WHEN DAY(@DOB) > DAY(GETDATE()) <br /> THEN 1 ELSE 0<br /> END<br />SELECT @tempdate = DATEADD(MONTH, @months, @tempdate)<br />SELECT @days =DATEDIFF(day, @tempdate ,GETDATE())<br />SELECT @Years as Years, @months as Months ,@days as [Days]<br /><br />Error messege is<br /><br />Msg 156, Level 15, State 1, Line 10<br />Incorrect syntax near the keyword 'THEN'.<br />Msg 156, Level 15, State 1, Line 15<br />Incorrect syntax near the keyword 'CASE'.<br /><br />Then will not exept in OR and AND<br />please teacher send me correct code in<br />my email f.bilaal0007@gmail.com<br /><br />Anonymoushttps://www.blogger.com/profile/03807811452421678217noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-74481491823844890962012-10-20T05:15:21.335-07:002012-10-20T05:15:21.335-07:00Hi Mr Venkat,
This is to thanks from bottom of hea...Hi Mr Venkat,<br />This is to thanks from bottom of heart for such a nice collection in one place , C#, ASP.NET, SQL SERVER tutorials and Interview questions all of them helping lot in my preparation . Keep doing hard wark . god bless you<br /><br />Anonymoushttps://www.blogger.com/profile/05597838364516561885noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-8319633512971110332012-08-21T10:37:02.979-07:002012-08-21T10:37:02.979-07:00Thank you for your wonderful work!!Thank you for your wonderful work!!Anonymoushttps://www.blogger.com/profile/00140179616961960757noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-26741721268583997222012-08-14T00:12:15.476-07:002012-08-14T00:12:15.476-07:00Hi Venkat,
This is awesome zone, where i clear my...Hi Venkat,<br /><br />This is awesome zone, where i clear my fundamental concept to remember easily and getting confident to clear interview.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-17532742596872034772011-11-26T01:45:29.863-08:002011-11-26T01:45:29.863-08:00Hi there, awesome site. I thought the topics you p...Hi there, awesome site. I thought the topics you posted on were very interesting. I tried to add your RSS to my feed reader and it a few. take a look at it, hopefully I can add you and follow.Job Interview Questionshttp://jobinterviewtips.in/noreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-25965977851143922432011-10-23T02:25:49.826-07:002011-10-23T02:25:49.826-07:00Really nice collection of SQL Questions. Thanks fo...Really nice collection of SQL Questions. Thanks for the nice post.<br /><br />Priya Sharma<br />Senior Software Engineer, AccentureSQL Server Interview Questions And Answershttp://www.questionanswerhub.com/answers/microsoft-sql-server-interview.aspxnoreply@blogger.comtag:blogger.com,1999:blog-5562253332413822713.post-6092869870625054242011-05-21T08:18:00.363-07:002011-05-21T08:18:00.363-07:00Dear Mr.Venkat,
Thank u very much for such an orga...Dear Mr.Venkat,<br />Thank u very much for such an organized collection. I cleared my interview after reading this blog for 2 times.<br /><br />- AnupAnonymousnoreply@blogger.com