Rowcount

  • Comments posted to this topic are about the item Rowcount

  • not quite sure, but tried it on 3 different servers, each with a different version, and all returned 1 and 1.

    not getting the 0 and 1 as indicated as the c0rrect answer......

    explanation?

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • I experienced the same result (1,1) in both sql server 2005 and 2008 EE

  • Hi

    I too experienced the same result (1,1). I tried it in sql 2005.

    pls give the explanation......

  • First result depends on what has been run previously in the query window. If nothing has been run, then get a 1, second result is 1.

    If a SET option e.g. SET NOCOUNT ON/OFF has been done first, then the first result is a 0

  • It is correct.

    I also confused the same.but the question is improper.because if we execute the query it shows the result as 1,1.but it will show 0,1 for your case.the result depends on previous statement.

    By default it is 1. The question is improper.

    Malleswarareddy
    I.T.Analyst
    MCITP(70-451)

  • tried on sqlserver 2000,2005, 2008.. result obtained from query in (1,1)..

    Can anyone explain regarding output... 0 ,1...???

  • This was removed by the editor as SPAM

  • Correct answer is (1,1), i have tested it from different verion of sql server.

  • i have executed the query on 2 different servers and for both of them i got the answer as 1,1...:(

  • thanks, i got my answer..

    even after opening a new window, i got the result as 1,1 and i was wondering why ???

    stewartc-708166 (1/28/2010)


    when a new query window is opened, a connection is made to the database, which returns a result (not visible)

    this item is reflected in the @@rowcount as 1

    however, SET NOCOUNT ON does reset this to 0.

    interesting question, I think this is going to be another interesting discussion...

  • First query returns 0 ONLY when SET ROWCOUNT {something} is executed first. It doesn't matter to which value ROWCOUNT is set (2008EE).

    Interesting issue but answer to the question is wrong

  • Hi

    I too experienced the same result (1,1). I tried it in sql 2008

    pls give the detailed explanation for the same......

  • 1,1 in that case when u have opened a new qurey window and executed that statement and 0,1 in case when u have executed a select statement, which returns nothing and then u execute the same rowcount statement. So by default 1,1 is the correct answer.

  • I too got 1,1 in sql server 2008 :w00t:

Viewing 15 posts - 1 through 15 (of 132 total)

You must be logged in to reply to this topic. Login to reply