Forum Replies Created

Viewing 15 posts - 91 through 105 (of 452 total)

  • RE: Beginning a CTE

    This (and MERGE) is why I have begun the habit of separating my statements with semicolons on their own line:

    BEGIN

    MERGE INTO

    ....

    ;

    WITH CTE AS ...

    ;

    END

    This makes the semicolons more obvious, and...

  • RE: Binary Compare

    So this is the VARBINARY equivalent of:

    DECLARE @a VARCHAR(20) = ' '

    , @b-2 VARCHAR(20) = ' ...

  • RE: ORDER BY ASC and NULLs last

    Hugo Kornelis (4/7/2016)


    Stewart "Arturius" Campbell (4/6/2016)


    Interesting, never thought of doing it that way

    Nice question, thanks Horia

    Nor should you. In production code, I would always write out the explicit intent instead...

  • RE: The SIGN

    Good question, but the explanation is wrong on one point:

    The MIN() and MAX() functions are aggregates, therefore the NULL is eliminated.

    is not true.

    The reason the NULL is eliminated...

  • RE: ANSI_NULLS

    While answer #4 is a true statement (and so is #1, as others have mentioned), it doesn't really answer the question.

    WHY should you not set ANSI_NULLS to OFF?

    Because SET...

  • RE: ORDER BY and NULL

    Kaye Cahs (3/11/2016)


    In my opinion, the sort results should be unpredictable because NULL is an unknown/unspecified value, which implies it cannot be sorted.

    I'm not arguing that the answer is incorrect....

  • RE: How many peers?

    emiddlebrooks (3/4/2016)


    Why not start it at max negative and use the negative side as well? Then you would have almost twice as many...

    Almost twice as many?

    My math says that...

  • RE: CHECKING specific values

    Bob JH Cullen (2/23/2016)


    This harks back to a similar post a little while back, and as a result I got this right. However, I still fail to see any logic...

  • RE: The Path

    TomThomson (2/19/2016)


    Nice question, but ambiguous wording in the explanation - "up to " can mean either "up to and including" or "up to but not including ".

    Sometimes the...

  • RE: Shortening a column

    John Mitchell-245523 (1/8/2016)


    There are circumstances in which option 4 is the correct answer. The question does not state that the table is empty, nor does it say anything about...

  • RE: The Improvement

    Iwas Bornready (12/21/2015)


    I am assuming that if you don't specify a value to be used in case there is no next year, that it returns zero as the default.

    No. If...

  • RE: Outer Joins

    I have never been so glad to get a question wrong.

    Having never seen the WHERE *= syntax before, I assumed it was a new thing and picked what I...

  • RE: Included Indexes

    patrickmcginnis59 10839 (12/16/2015)


    tom.w.brannon (12/16/2015)


    I don't understand why non-clustered is required. While not a best practice, why couldn't you include the non-key columns in the definition of the clustered index?

    I'm...

  • RE: Big plans

    Interesting. I haven't studied the plan cache in detail, so I guessed the answer.

    There's a typo and a math error in the paragraph about query size:

    There is a limit on...

  • RE: ExecuteNonQuery

    paul.knibbs (12/10/2015)


    sknox (12/10/2015)

    Well, a query is a question, which implies an answer.

    So "NonQuery" implies you never asked the question in the first place, which is exactly the point I was...

Viewing 15 posts - 91 through 105 (of 452 total)