-
Running SQL instruction stored in @variable
Does anybody know how I can run some SQL Server instruction stored in variable in stored procedure (for instance @var = 'SELECT AuthorName FROM Authors'. I need it for creating dynamic sql select queries.
-
Running SQL instruction stored in @variable (reply)
hi dmitrij
You must call it EXEC(@var)
But you cannot access for example local variables in @var, defined outside @var.
bye
------------
Dmitry at 8/12/01 7:03:31 AM
Does anybody know how I can run some SQL Server instruction stored in variable in stored procedure (for instance @var = 'SELECT AuthorName FROM Authors'. I need it for creating dynamic sql select queries.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|