Forum Replies Created

Viewing 15 posts - 2,521 through 2,535 (of 3,957 total)

  • RE: 100 Most famous interview Questions and Answers

    I think interviewers should play Jeopardy with the interviewees.

    Answer: ambiguous column

    Question: What is the error message you get when you don't sufficiently qualify a column reference with the associated table...

  • RE: 100 Most famous interview Questions and Answers

    Luis Cazares (10/31/2012)


    GSquared (10/31/2012)


    On the other hand ... if anyone ever publishes "Trivial Pursuit, DBA Edition", they could come in very handy indeed!

    Would you buy it? Or would you...

  • RE: T-SQL to call the SQL Parse "function"

    Jeff Moden (11/1/2012)


    Jason Selburg (11/1/2012)


    Good idea dwain, but I do not want to/ can not execute the statements.

    I need only to check the syntax.

    Also, the syntax can be...

  • RE: T-SQL to call the SQL Parse "function"

    Still haven't found the definitive answer but I did think of this approach.

    It might work a little better and could conceivably be used with INSERTs, UPDATEs and DELETEs!

    DECLARE @sql VARCHAR(8000)...

  • RE: T-SQL to call the SQL Parse "function"

    A pure SQL solution, using Lowell's example might be like this:

    DECLARE @sql VARCHAR(8000) = 'SELECT * FROM FROM sys.objects'

    BEGIN TRY

    EXEC (@SQL)

    END TRY

    BEGIN CATCH

    ...

  • RE: T-SQL Cursors

    computergirl (10/16/2012)


    Okay I am kind of new to this and I am trying to create a table and if the user doesn't fill all the fields I need the empty...

  • RE: Add Minute

    Perhaps it is something like this that you seek:

    ;WITH Dates AS (

    SELECT MyDate

    FROM (

    VALUES ('2012-10-28'),('2012-10-29'),('2012-10-30')) a (MyDate)),

    Tally (n)...

  • RE: Some way to write an INNER JOIN, but joining on either of two columns

    matt6749 (10/29/2012)


    Hi,

    Each doctor in my doctors table has a main zip code and an alternate zip code.

    SELECT D.*

    FROM Doctors D

    INNER JOIN ZipCodes Z

    ON D.MainZip = Z.ZipCode

    OR D.AlternateZip =...

  • RE: SELECT DISTINCT AND ORDER BY CASE

    28.kanikasoni (10/31/2012)


    Hi,

    Thanks 4 ur solution but I am getting error in order clause

    Incorrect syntax near the keyword 'order'.

    Incorrect syntax near the keyword 'ELSE'.

    Incorrect syntax near the keyword 'ELSE'.

    Try removing the...

  • RE: SQL Merge Question

    I believe Jerry's answer is correct.

    What you want to do is this:

    WHEN MATCHED THEN BEGIN

    INSERT INTO @BookChangeTracking(TitleID,OldQuantity,NewQuantity,ChangeDate)

    VALUES(bi.TitleID,bi.Quantity,bi.Quantity+bo.Quantity,getdate())

    UPDATE SET bi.Quantity = bi.Quantity + bo.Quantity

    END

    But the MERGE statement doesn't support BEGIN...

  • RE: can i get result of EXEC sp_executeSQL as record set?

    While it will, you won't be able to manipulate results in the client.

    To do that, you'd need to INSERT into a temporary table within the dynamic SQL. That table,...

  • RE: Customery Survey Query with no Duplicates

    T_Dot_Geek (10/31/2012)


    Please follow below article helps you how to provide more clarity for your post

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    We're asking the OP to make it easier for us so let's make it easy for...

  • RE: Getting Output value from sp_executesql for XML issue

    No need to be embarrassed and you're welcome.

    You'd be surprised how often the simplest issue is uncovered quickly by a second set of eyes. In this case, I happened...

  • RE: Getting Output value from sp_executesql for XML issue

    Try this:

    DECLARE @tApplXML XML

    ,@SQL NVARCHAR(max)

    ,@ParmDefinition NVARCHAR(1024)

    ,@applnbr int

    set @applnbr = 24

    SET @sql = N'SELECT @ptApplXML = (SELECT * FROM [database].[dbo].

    WHERE [ApplNbr] = @pApplNbr

    FOR XML PATH(''database.table''))'

    SET @ParmDefinition...

  • RE: Using SUM(1) to count Rows (vs Count(1))

    Somewhere I heard that COUNT(*) is optimized for this specific case (not Craig's conditional count).

    If you'd like a faster way that doesn't need to do a table scan, this technique...

Viewing 15 posts - 2,521 through 2,535 (of 3,957 total)