Tahir
03-22-2000, 05:21 PM
I am looking for a way to retrieve column values from dynamic SQL. I have
to use dynamic SQL because my tablenames are stored in a catalog table. Here's
the code snippet!
select @str = 'Select userid from ' + @tblName + ' where id=2'
exec(@str)
I want to retrieve userid from this dynamic sql to execute more sql statements
without going back to client script.
Select @userid=userid wont work because of variable scope. I can use cursors
but it is definitely more overhead.
Thanks.
to use dynamic SQL because my tablenames are stored in a catalog table. Here's
the code snippet!
select @str = 'Select userid from ' + @tblName + ' where id=2'
exec(@str)
I want to retrieve userid from this dynamic sql to execute more sql statements
without going back to client script.
Select @userid=userid wont work because of variable scope. I can use cursors
but it is definitely more overhead.
Thanks.