user1216456
user1216456

Reputation:

Sql Server Cursor error (incorrect syntax near the "a" sign)

The following query results in an error with the following message:

Incorrect syntax near the keyword 'for'. How should I get around this error...

I think in the query below SQL Server does not like the "@" sign.....

Any thoughts? Thanks!!!

Declare ObsSet_Cursor for 
 Select o.EventSetName,
        o.EventSetDisplay, 
        o.EventSetDescription, 
        o.ChildSetName
  From   ##Final f, 
         ##ObsSetLevel o
  Where  f.ChildSetName = o.EventSetName and 
         f.ChildSetName = @str 

Upvotes: 0

Views: 1041

Answers (1)

i-one
i-one

Reputation: 5120

You missed cursor keyword:

Declare ObsSet_Cursor cursor for ...

Upvotes: 1

Related Questions