January 28, 2010 at 9:27 pm
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
January 28, 2010 at 9:32 pm
I experienced the same result (1,1) in both sql server 2005 and 2008 EE
January 28, 2010 at 9:36 pm
Hi
I too experienced the same result (1,1). I tried it in sql 2005.
pls give the explanation......
January 28, 2010 at 9:39 pm
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
January 28, 2010 at 9:47 pm
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)
January 28, 2010 at 10:07 pm
tried on sqlserver 2000,2005, 2008.. result obtained from query in (1,1)..
Can anyone explain regarding output... 0 ,1...???
January 28, 2010 at 10:32 pm
This was removed by the editor as SPAM
January 28, 2010 at 11:04 pm
Correct answer is (1,1), i have tested it from different verion of sql server.
January 28, 2010 at 11:05 pm
i have executed the query on 2 different servers and for both of them i got the answer as 1,1...:(
January 28, 2010 at 11:06 pm
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...
January 28, 2010 at 11:19 pm
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
January 28, 2010 at 11:23 pm
Hi
I too experienced the same result (1,1). I tried it in sql 2008
pls give the detailed explanation for the same......
January 28, 2010 at 11:23 pm
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.
January 28, 2010 at 11:30 pm
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