Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Set Rowcount error on SQL7 but not SQL2000

Author  Topic 

Pete32
Starting Member

4 Posts

Posted - 2007-03-30 : 11:13:06
We recently switched over from SQL7 to SQL2000 and a new error has come up. The statements below raise the "Invalid argument for SET ROWCOUNT. Must be a non-null non-negative integer." error on SQL2000 but not SQL7.

declare @row integer
set @row = null
set rowcount @row

I understand that this error should occur, but why doesn't it raise an error on our SQL7 server. I'm guessing this has to do with the configuration options, but I can't figure which one. Please help.

X002548
Not Just a Number

15586 Posts

Posted - 2007-03-30 : 12:46:54
you're just now moving to 2000?

SELECT @row = @@ROWCOUNT



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Pete32
Starting Member

4 Posts

Posted - 2007-03-30 : 17:20:49
Thanks Brett, but that's not what I'm trying to do. I'm trying to dynamically set the rowcount.
Go to Top of Page

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-03-30 : 17:35:48
I'm guessing it's just better/different error handling in 2000 - as you said it should be an error, 2000 is just giving the error as it should. If you don't get the error in 7.0 then it was a bug in 7.0. You wouldn't want an option in 2000 to make it behave like the bug in 7.0, even if that was more compatible.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-03-31 : 10:51:17
You wouldn't want to code incorrectly in the first palce...I don't have access to any 7 boxes (or 6.5) anymore, but it's so wrong in the first place...fix the code

Anyone worked of 4.x?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-03-31 : 10:52:52
And what does that even mean....dynamically trying to set rowcount

Why would you want to do that?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

Pete32
Starting Member

4 Posts

Posted - 2007-04-02 : 08:21:40
A bug in SQL7....that sounds like the most likely reason. Thanks snSQL.
Go to Top of Page

Wang
Starting Member

48 Posts

Posted - 2007-04-02 : 08:59:19
quote:
Originally posted by X002548

And what does that even mean....dynamically trying to set rowcount

Why would you want to do that?



Presumably because you can't call select top n?
Go to Top of Page
   

- Advertisement -