ronaldmacdonald
MIS
Im trying to increment a variable in a select statement
such as
declare @cnt as int
select field1, field2,(select @cnt = @cnt + 1)
from A_TABLE
but Im getting an "incorrect syntax error near =" message. Ive tried various combinations to no avail. Is this possible?
such as
declare @cnt as int
select field1, field2,(select @cnt = @cnt + 1)
from A_TABLE
but Im getting an "incorrect syntax error near =" message. Ive tried various combinations to no avail. Is this possible?