Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Rowcount Expand / Collapse
Author
Message
Posted Thursday, January 28, 2010 8:44 PM
Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Monday, August 25, 2014 10:25 PM
Points: 698, Visits: 158
Comments posted to this topic are about the item Rowcount
Post #855739
Posted Thursday, January 28, 2010 9:27 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, August 28, 2014 2:39 AM
Points: 1,880, Visits: 2,846
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?


----------------------------------------------
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
Post #855747
Posted Thursday, January 28, 2010 9:32 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, December 12, 2014 2:28 AM
Points: 414, Visits: 107
I experienced the same result (1,1) in both sql server 2005 and 2008 EE
Post #855748
Posted Thursday, January 28, 2010 9:36 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, February 15, 2011 10:05 PM
Points: 379, Visits: 171
Hi

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

pls give the explanation......
Post #855749
Posted Thursday, January 28, 2010 9:39 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, March 30, 2014 8:18 PM
Points: 2,778, Visits: 477
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



Post #855752
Posted Thursday, January 28, 2010 9:47 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, November 25, 2014 11:09 PM
Points: 1,940, Visits: 1,173
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)
Post #855754
Posted Thursday, January 28, 2010 10:07 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, March 25, 2013 7:14 AM
Points: 196, Visits: 60
tried on sqlserver 2000,2005, 2008.. result obtained from query in (1,1)..

Can anyone explain regarding output... 0 ,1...???
Post #855760
Posted Thursday, January 28, 2010 10:32 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 10:51 AM
Points: 4,158, Visits: 5,556
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...


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #855768
Posted Thursday, January 28, 2010 11:04 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, August 3, 2013 10:01 AM
Points: 103, Visits: 88
Correct answer is (1,1), i have tested it from different verion of sql server.
Post #855775
Posted Thursday, January 28, 2010 11:05 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Sunday, November 2, 2014 11:03 PM
Points: 2,132, Visits: 371
i have executed the query on 2 different servers and for both of them i got the answer as 1,1...

Post #855776
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse