Yes, any T-SQL statement affects @@ROWCOUNT. You should store it value in a local variable if you are intending to use it later.
>I have a debug problem. When running this code (just a small snippet) with the print statement, I have no problem, but if I remove the print statement or move it above the select, I end up in a loop. Does the print effect the @@Rowcount some how?
>
>
> SELECT @RoomDate = RoomDate, @DeptId = DeptId, @DeptDesc = DeptDesc,
@RoomId = RoomId, @RoomName = RoomName, @SpaceStart = SpaceStart, @SpaceEnd = SpaceEnd, @SpaceMinutes = SpaceMinutes
> FROM @OUTPUT
> WHERE ID = @TempId
>
> print 'Test'
>
> WHILE(@@ROWCOUNT > 0)
> BEGIN
>
>
>Thanks for any thoughts.
--sb--