Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quick T-SQL syntax question
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00691600
Message ID:
00691626
Views:
7
>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--
Previous
Reply
Map
View

Click here to load this message in the networking platform