SQL SERVER – 2008 – Interview Questions and Answers Complete List Download

The interview is a very important event for any person. A good interview leads to good career if the candidate is willing to learn. I always enjoy interviewing questions and answers series. This is my very humble attempt to write SQL Server 2008 interview questions and answers. SQL Server is a very large subject and not everything is usually asked in interview. In interview what matters the most is the learning attitude.

Interview Questions

An interview Question and Answer discussion can be very helpful to both these individuals.  It is simply a way to go back over the building blocks of a topic.  Many times a simple review like this will help “jog” your memory, and all those previously-memorized facts will come flooding back to you.  It is not a way to re-learn a topic, but a way to remind yourself of what you already know.

I have listed all the series in this post so that it can be easily downloaded and used. All the questions are collected and listed in one PDF which is here to download. If you have any question or if you want to add to any of the questions, please send me a mail or write a comment about interview questions.

Click here to get free chapters (PDF) in the mailbox

Reference : Pinal Dave (https://blog.sqlauthority.com)

, ,
Previous Post
SQL SERVER – 2008 – Interview Questions and Answers – Part 8
Next Post
SQL Server – 2008 – Cheat Sheet – One Page PDF Download

Related Posts

160 Comments. Leave new

  • Hi pinal,

    This is good for fresh people who just learn sql server and want to job as developer.
    But pinal , I am looking for some technical interview question with answer and some technical example as well.
    Because in some job people take interview with situation , action and result.
    I am looking that kind of interview question and answer.

    Reply
  • Hi Pinal,

    I’m having a very hard time in findig a way to enter my @FromDate and @ToDate into my procedure…can you please help and show me where do i need to enter these. Thank you so much in advance

    CREATE Procedure dbo.UHS_Rapidresponsedoc_RS_PR
    (@JobId int
    )
    as
    Begin
    Set NoCount on
    Declare @FromDate DATETIME
    Declare @ToDate DATETIME
    Declare @SubmittedReportGUID HVCIDdt
    DECLARE @InputParamTable TABLE
    (
    InternalValueGUID VARCHAR(30),
    ValueFrom VARCHAR(255),
    Name VARCHAR(30)

    )

    SET @SubmittedReportGUID = (SELECT
    SubmittedReportGUID
    FROM HVCRequestedReport
    WHERE JobID = @JobId)
    INSERT INTO @InputParamTable
    SELECT InternalValueGUID,
    ValueFrom,
    Name
    FROM HVCSubmittedParameter
    WHERE SubmittedReportGUID = @SubmittedReportGUID

    –Select * from @InputParamTable

    — Get the Report Date Intervals
    SELECT @FromDate =
    CASE
    WHEN LEFT(RP.ValueFrom,1) = ‘t’ AND LEN(RP.ValueFrom) = 1 THEN
    CONVERT(varchar(11), GetDate())
    WHEN LEFT(RP.ValueFrom,1) = ‘t’ AND PATINDEX(‘%+%’,RP.ValueFrom) 0 THEN
    DATEAdd(dd,convert(numeric,LTRIM(RIGHT(RP.ValueFrom,LEN(RP.ValueFrom)-PATINDEX(‘%+%’,RP.ValueFrom)))),CONVERT(datetime,CONVERT(varchar(11),GetDate())))
    WHEN LEFT(RP.ValueFrom,1) = ‘t’ AND PATINDEX(‘%-%’,RP.ValueFrom) 0 THEN
    DateAdd(dd,-convert(numeric,(LTRIM(RIGHT(RP.ValueFrom, LEN(RP.ValueFrom)-PATINDEX(‘%-%’,RP.ValueFrom))))),CONVERT(datetime,CONVERT(varchar(11),GetDate())))
    ELSE CONVERT(datetime,RP.ValueFrom)
    END
    from @InputParamTable RP
    where RP.Name = ‘HVCFromDate’

    SET @FromDate = CAST((SELECT @FromDate
    ) + ‘ ‘ + (SELECT
    ISNULL(ValueFROM, ’00:00’)
    FROM @InputParamTable
    WHERE Name = ‘HVCFROMTime’) AS DATETIME)

    SELECT @ToDate =
    CASE
    WHEN LEFT(RP.ValueFrom,1) = ‘t’ AND LEN(RP.ValueFrom) = 1 THEN
    CONVERT(varchar(11), GetDate())
    WHEN LEFT(RP.ValueFrom,1) = ‘t’ AND PATINDEX(‘%+%’,RP.ValueFrom) 0 THEN
    DateAdd(dd,convert(numeric,LTRIM(RIGHT(RP.ValueFrom,LEN(RP.ValueFrom)-PATINDEX(‘%+%’,RP.ValueFrom)))),CONVERT(datetime,CONVERT(varchar(11),GetDate())))
    WHEN LEFT(RP.ValueFrom,1) = ‘t’ AND PATINDEX(‘%-%’,RP.ValueFrom) 0 THEN
    DateAdd(dd,-convert(numeric,(LTRIM(RIGHT(RP.ValueFrom, LEN(RP.ValueFrom)-PATINDEX(‘%-%’,RP.ValueFrom))))),CONVERT(datetime,CONVERT(varchar(11),GetDate())))
    ELSE CONVERT(datetime,RP.ValueFrom)

    END
    from @InputParamTable RP
    where RP.Name = ‘HVCToDate’

    SET @ToDate = CAST((SELECT @ToDate
    ) + ‘ ‘ + (SELECT
    ValueFROM
    FROM @InputParamTable
    WHERE Name = ‘HVCToTime’) AS DATETIME)

    select cv.providerdisplayname
    ,u.displayname as authoredprovider
    ,cv.clientdisplayname
    ,cv.idcode
    ,cv.visitidcode
    ,cd.createdwhen
    ,cd.documentname
    ,cd.AuthoredDtm
    ,cd.ArrivalDtm
    ,cp.DisplayName

    from cv3clientdocument cd
    inner join cv3clientvisit cv
    on cd.clientvisitguid = cv.guid
    inner join cv3user u
    on cd.authoredproviderguid = u.guid
    inner join cv3careprovider cp
    on cv.providerdisplayname = cp.displayname

    where cd.documentname not like ‘%Phone%’
    and cv.clientdisplayname not like ‘TEST%’
    and cd.documentname like ‘%Rapid%’
    and dateadd(dd, datediff(dd, 0, cd.ArrivalDtm ), 0) <= dateadd(dd, datediff(dd, 0, GETDATE()), 0)
    and cd.ArrivalDtm between @FromDate and @ToDate

    order by providerdisplayname,u.displayname,clientdisplayname

    Set NoCount off
    end

    Reply
  • parimal kumar jha
    March 19, 2012 9:47 am

    sir,
    please tell me what are the main differences between ms access and sqlserver . when to use both different application?

    Reply
  • Arshit verma
    March 26, 2012 3:26 am

    sir,
    please tell me how to count the number of column in a table?

    Reply
  • SELECT COUNT(SC.name) AS [Num of Columns]
    FROM sys.objects SO
    INNER JOIN sys.columns SC ON SC.object_id=SO.object_id
    WHERE type = ‘U’ AND SO.name = ‘Your Table_Name’

    Reply
  • sir plz solve my problem by query ,i.e. we need a query which select data from 2 tables –
    1- male(table1)
    2-female(table2)
    we need to get data which give alternative male and females value on by one.
    plz reply me.

    Reply
  • It is ggod to have and prepare . Thank you in advance.

    Reply
  • Sanaullah Khan
    April 28, 2012 1:27 pm

    hello sir ,
    i have this problem while attaching the northwind test database .as show
    sir how i can slow this :
    thank you
    Regards sanaullah

    TITLE: Microsoft SQL Server Management Studio
    ——————————

    Attach database failed for Server ‘HP-PCSQLEXPRESS’. (Microsoft.SqlServer.Smo)

    For help, click:

    ——————————
    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ——————————

    Unable to open the physical file “C:SQL Server 2000 Sample Databasesnorthwnd.mdf”. Operating system error 5: “5(Access is denied.)”. (Microsoft SQL Server, Error: 5120)

    Reply
  • very thanks man,

    Reply
  • is there a way i can print this book.

    Reply
  • What special Oracle feature allows you to specify how the cost based system treats a SQL statement

    Reply
  • Lalit Paymode
    October 30, 2012 8:52 am

    hey,can u tell me that,we are using oldb namespace in case oracle connectivity,and this also possible in case of sql2008 also,so what is needs to implement using.system,data,sqlclient

    Reply
  • Hi all.this is just a great blog for sql. my question is this:
    1. Write a database script that would achieve the following:
    a. A DB Schema for a banking scenario that serves clients with both loans and savings. (use back page)

    b. Database stored procedures to insert and/or update the database tables. (use back page)
    how can i be able to do this

    Reply
  • I bought your book with paper back but Is there anyway I can get online version like a ebook to read the same on my phone and computer?

    Reply
  • Hai sir i have sql interview in this week in MNC . please give me any tips to study sql with in two days. pls help me sir.?

    Reply
  • Hi Mr Pinal,
    I have monitored your blog for quite some time and I am to oblige to say thank you for the good work. After several attempts I am still unable to download or find your books on MSSQL interview questions and answers. All the links are pointing in the locations and nothing is available to download. Can you please urgently help as I have a number of interview lined up and you are the only one who could truly help with the online (PDF) format of the interview questions and answers. Please reply to email.

    Many Thanks.

    Dee.

    Reply
  • Is there a way to print the PDF? I am willing to purchase the PDF in order to print.

    Reply
  • akshay barve
    March 16, 2015 4:47 pm

    Execellent post sir.

    All questions are very usefull.

    I have a query for select statement.
    Suppose we have two records like ‘John Covil’ and ‘Jack peter’ and i want to match the string after the space in name. I mean suppose i search for ‘p’ the ‘Jack peter’ will be returned as after ‘Jack’ there is a space and ‘p’ is the first letter.

    Can you please help me out with this.

    Reply
  • shankar topale
    March 24, 2015 7:02 pm

    Very Helpfulll

    Reply
  • Hi,
    Your Questions are really very helpful.
    But I am unable to find the PDF for download.Can anyone help.
    I tried but its redirecting to another page but theres no way to download it.

    Reply

Leave a Reply Cancel reply

Menu
Exit mobile version