This is in SQL 2000. I need to select top (some) records from a view into a variable. I use:
declare @lastzip varchar(8000)
--@lastzip value obtained from another 'select' stmt
select @zip = top (@lastzip) zipcode + ',' From vwSalesTeam v
where v.userid = @userid order by zipcode asc
I get an error
Msg 170, Level 15, State 1, Procedure usp_search_ver5, Line 386
Line 386: Incorrect syntax near '='.
I was working in SQL 2005. I would have used the above code in SQL 2005. But now I'm using 2000 and I'm getting this error.
Could anyone tell me what I'm doing wrong here???
Any ideas/Suggestions are highly appreciated.
Thanks
Vijeya Shobana