Forum Replies Created

Viewing 15 posts - 1,426 through 1,440 (of 3,348 total)

  • RE: Lists

    DrKiller (12/23/2014)


    wow what a complex way of doing it.

    I'm usually just doing this 🙂

    DECLARE @tmpString VARCHAR(MAX)

    SELECT @tmpString = COALESCE(@tmpString + ', ' + productname, productname) FROM Header

    SELECT @tmpString

    Others already pointed...

  • RE: Lists

    Good question. Happy to see that STUFF is getting some love here - I often see code that is way more complicated than it should be because people avoid (or...

  • RE: T-SQL

    Good question, though not the first time I have seen it.

    The explanation can be improved. What happens is that ISNULL is defined as returning the same data type as the...

  • RE: I have no id

    zaff_mind (12/20/2014)


    Please explain

    Here is a good link: http://www.sqlservercentral.com/questions/T-SQL/119847/

    Scroll to where you see a blue box and read the text inside of it. 🙂

  • RE: Fun with XOR #1

    DonlSimpson (12/8/2014)


    Hmm. Of course I tested it "before making such claims."

    Ouch!

    I stand corrected. My apologies.

    I do believe that this is a violation of the ANSI standard. Maybe not of...

  • RE: Fun with XOR #1

    DonlSimpson (12/8/2014)


    Hugo Kornelis (12/7/2014)


    This code does a "swap" of two variables without requiring a third temporary variable

    Ahem. Why not simply use a single SELECT?

    SELECT @a = @b, @b = @a;

    This...

  • RE: Fun with XOR #2

    DonlSimpson (12/6/2014)


    Comments posted to this topic are about the item <A HREF="/questions/T-SQL/119238/">Fun with XOR #2</A>

    There are good use cases for bitwise logic in SQL Server. This is not one of...

  • RE: Fun with XOR #1

    This code does a "swap" of two variables without requiring a third temporary variable

    Ahem. Why not simply use a single SELECT?

    SELECT @a = @b, @b = @a;

    Set-based logic has many...

  • RE: Trace Flag

    Koen Verbeeck (12/4/2014)


    I had to Google this, because I did not understand at least 9 words from that question. 😀

    I had to Google as well, but for a different reason....

  • RE: TABLESAMPLE output

    SQL-DBA-01 (12/4/2014)


    To me the results is only 5.

    How often did you try?

  • RE: IF EXISTS vs @@ROWCOUNT

    Final note: I do want to stress that the message that the author tried to convey is correct and relevant. He just chose an incorrect context.

    But if you need to...

  • RE: IF EXISTS vs @@ROWCOUNT

    DonlSimpson (11/26/2014)


    Actually, given that the question was which method is fastest for the INSERT, then option 2 is correct. If the question were "Which method is most efficient for...

  • RE: IF EXISTS vs @@ROWCOUNT

    TomThomson (11/26/2014)


    If you make two tables, once called @table and the other called @tible, say, both with the same content, and make one of the methods operate on @table and...

  • RE: IF EXISTS vs @@ROWCOUNT

    Sorry for the harsh words, but this is absolute rubbish.

    The code in option 2 will always do two lookups. One for the EXISTS, and then another one for either the...

  • RE: Index Behaviour

    DrKiller (11/20/2014)


    Would the first query not use the clustered index?

    It makes no sense why it would even consider the non-clustered index

    Good question, though the explanation is a bit lacking and...

Viewing 15 posts - 1,426 through 1,440 (of 3,348 total)