Dynamic SQL Cursor Column Problem
Here is an example of cursor.
VB Code:
declare @a varchar(100)
declare c1 cursor for select name from sysobjects where name like 'x%'
open c1
fetch next from c1 into @a
while @@fetch_status =0
begin
print @a
fetch next from c1 into @a
end
close c1
deallocate c1
Here we know the cursor SQL string. In case if I try to convert it as an SP and how do I iterate through the columns of the query which are passed dynamically?
Thanks,
Jai
Re: Dynamic SQL Cursor Column Problem
This should be posted in the Database Development Forum .