Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Declare cursor as a variable
Message
From
09/08/2005 12:42:19
Stephen Hunt
Admit Computer Services Inc.
Farmingdale, New York, United States
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Declare cursor as a variable
Miscellaneous
Thread ID:
01039571
Message ID:
01039571
Views:
66
I am trying to build my select statement into a variable
declare @query varchar(8000)
set @query='select * from filename'
when I try to execute my declare cursor
declare cursor for @query
I get an error 'incorrect syntax near @query'

does SQL server allow for creating a cursor based on a select statement
built into a variable ? and if so what am I doing wrong ?

Thanks For Your Help !
Next
Reply
Map
View

Click here to load this message in the networking platform