I'd like to output the result from a query in a stored procedure.
The challenge is that the result from the query is unknown, so i'd like to iterate through the returned rows and output each field dynamically.
if object_id('dbo.create_insert') is not null
drop procedure dbo.create_insert
create procedure dbo.create_insert(
, @personnr int
, @tablename varchar(8)
declare cur_create_insert cursor for
where birthdate = @birthdate
and personnr = @personnr
open cursor cur_create_insert
while (result has more rows)
while (there are more columns)