I am using a combination of SQL Server 6.5 and 2000.
If I issue a SELECT statement in 6.5 and then query @.@.ROWCOUNT I get the correct value of it, e.g.
SELECT * FROM EMPLOYEES
IF @.@.ROWCOUNT > 0
...etc
But in SQL Server 2000, I only get the correct value if I SELECT it after, like this, e.g.
SELECT * FROM EMPLOYEES
SELECT @.@.ROWCOUNT
IF @.@.ROWCOUNT > 0
...etc
And it also seems to work in 2000 if you put @.@.ROWCOUNT into a variable, and query the variable.
Has anyone alse had this problem, and is it a bug in 2000 ?
Thanks,
itsmarkdavies@.hotmail.com@.@.rowcount works exactly the same in sql2k.
e.g.
declare @.cnt int
select * from employees
select @.cnt=@.@.rowcount
if @.cnt>0
begin
print 'you get @.@.rowcount fine'
end
No comments:
Post a Comment