Forum Replies Created

Viewing 15 posts - 1,771 through 1,785 (of 3,348 total)

  • RE: Sum and Count

    manik123 (4/23/2013)


    but where is the group by.....???? it is working without group by.....?????

    If the SELECT clause of a query contains ONLY aggregate functions, you can leave out the GROUP BY....

  • RE: Handling NULL

    Mr. Kapsicum (4/23/2013)


    friends, since i am new to sql, i have little confusion with this query ( i.e. choice number two and four)

    Choice two: SELECT ID, COALESCE(IsAvailable, GETDATE()) FROM #Test

    ...

  • RE: Nested triggers 1

    The first sentence of the explanation should probably have read "Instead of triggers can cascade regardless of the setting of the nested trigger server option."

    The question IDEA is very good....

  • RE: Update with CASE statement

    ramana3327 (4/19/2013)


    Is it possible to insert values in only one column? Actually there are two columns in table they updating only one column what will happen to second

    The other column...

  • RE: Triggers 1

    Mike Dougherty-384281 (4/19/2013)


    How does the trigger affect multi-row insert if one fails the trigger condition? How would that scenario be different with CHECK constraint?

    The trigger would roll back the...

  • RE: Triggers 1

    L' Eomot Inversé (4/19/2013)


    There is one issue with the question, albeit an utterly trivial one: it depends on the setting of IMPLICIT_TRANSACTIONS for the connection. If that's set ON,...

  • RE: Triggers 1

    Christian Buettner-167247 (4/19/2013)


    Hi,

    There is one subtle issue with the explanation (and also the MS documentation).

    It is not the ROLLBACK that is causing the abort of the batch. Instead, the...

  • RE: Triggers 1

    Danny Ocean (4/19/2013)


    Hugo, Question title is "Triggers 1", so everybody look at trigger (even be also). But trick was in "GO"

    I think question title should be "GO". 🙂

    Try what happens...

  • RE: Triggers 1

    kapil_kk (4/18/2013)


    oopes,

    I think I have misunderstood the way to execute the given query...

    Oohhh, I am so sorry that the comments in the code made you misunderstand the question. I added...

  • RE: Triggers 1

    Dineshbabu (4/18/2013)


    If insert statement was within Explicit transaction then even first row will not be inserted and the result of final query will be 0. Am I right?

    Yes (assuming you...

  • RE: Sum and Count

    TaylorMade (4/18/2013)


    The problem I have is the supposed formula to arrive at the SUM. The true formula is 1+2+3+1+2+3 = 12. I don't see how you can apply...

  • RE: COUNT() Function

    Dineshbabu (4/18/2013)


    Is there anyway to make COUNT() to consider even NULL values?? I mean any set options or something like that?

    Yes. Just use COUNT(*).

  • RE: Row Constructor

    Good question. Not perfect, though.

    When I read the question in the daily newsletter, I expected the answer options to be "yes" or "no", and I was fully ready to reply...

  • RE: Why doesn’t ISNUMERIC work correctly? (SQL Spackle)

    mark.gilbert (4/16/2013)


    Am I missing something, or is this the exception to the rule?

    What Lynn said. 🙂

    For ensuring that the empty string is not treated as numeric, I would personally not...

  • RE: COUNT() Function

    rals (4/16/2013)


    (...)

    The above code returns 5, 5, 4. Based on the output it looks like COUNT(*) and COUNT(1) returns the number of rows, regardless of content.

    COUNT(*) returns the number of...

Viewing 15 posts - 1,771 through 1,785 (of 3,348 total)