Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: 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.

    ab

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    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
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Mar 2004
    Posts
    2
    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?

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    It doesn't work for the execution of a sproc....
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •