>How can I redirect the output of SP_COLUMNS to a #temptable?
>
>I'm writing a generic stored proc that 'scans' through the columns in a table. I know that SP_COLUMNS will return a list of column info for a table...but I haven't figured out how to redirect it to something that I can scan through. Any ideas?
>
In Sql 2000 you can use INFORMATION_SCHEMA columns view.
SELECT * INTO #temp1
FROM INFORMATION_SCHEMA.COLUMNS
Otherwise you'll have to create table with structure coresponded to the result set returned by stored procedure and use INSERT ... EXEC to capture SP result. See for example
Re: Using result set Thread #
644014 Message #
644072
--sb--