Wednesday, February 15, 2012

Export sp_columns result into a temp table?

Can anyone show me the syntax for exporting the result of sp_columns into a new table?
I've tried using "SELECT EXEC sp_columns...INTO 'column_info'" but I keep getting syntax errors that are unclear to me.
Any help would be greatly appreciated.
abYou need to create a table with the same number of columns as the result set first

Look at

USE Master
GO
sp_helptext sp_columns
GO

to find the detail

Then do INSERT INTO yourTable(cOL LIST) exec SP_Columns TABLE|||Originally posted by Brett Kaiser
You need to create a table with the same number of columns as the result set first

Look at

USE Master
GO
sp_helptext sp_columns
GO

to find the detail

Then do INSERT INTO yourTable(cOL LIST) exec SP_Columns TABLE

I thought a SELECT INTO... type statement would create the table for me?|||It doesn't work for the execution of a sproc...

No comments:

Post a Comment