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 Development (2000)
 incrementing variable?

Author  Topic 

brianlitt
Starting Member

8 Posts

Posted - 2002-07-03 : 14:12:30
I figured this would be easy but i'm trying to increment a local variable.

@TOTAL = @TOTAL + 1

Is this the wrong way or what?

Thanks,
Brian

macka
Posting Yak Master

162 Posts

Posted - 2002-07-03 : 14:15:49
Make sure you declare and initialise the variable:

DECLARE @TOTAL INTEGER
SET @TOTAL = 0

...
SET @TOTAL = @TOTAL + 1
..

macka.

Go to Top of Page
   

- Advertisement -