Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2003
    Posts
    294

    Exclamation Unanswered: Returning Resulset

    Hello, I need to do the following, But I receive an error:


    CREATE PROCEDURE dbo.EJEMPLO_A AS
    BEGIN
    SELECT TOP 10 NAME, ID FROM SYSCOLUMNS
    END
    -- and Later use the one above... like this...


    CREATE PROCEDURE dbo.EJEMPLO_B AS
    BEGIN

    DECLARE @temp_lista TABLE (NOMBRE VARCHAR(500),
    IDENT NUMERIC(5))

    INSERT INTO @temp_lista execute dbo.EJEMPLO_JULIAN

    END

    Pd. I just have to capture the dbo.EJEMPLO_A resulset... and I can't modify It

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    Table variables cannot be used in a INSERT EXEC or SELECT INTO statement.

    http://support.microsoft.com/default.aspx/kb/305977

    in your second sproc you can use a temp table and it should be ok. EDIT: however this sproc will do nothing because it's not returning any data, or modifying any data in any permanent tables. so why bother?
    Last edited by jezemine; 01-02-07 at 17:54.

Posting Permissions

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