Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2002
    Location
    Nepal
    Posts
    32

    Unanswered: Insert from SP --Error

    HI,

    I am trying to insert result from SP to the table. But it looks there is something wrong in my code, which is thronging error.

    BEGIN
    INSERT INTO dbo.my_tab7 (name)
    exec Test_SP '3333'
    end

    Error : Incorrect syntax near the keyword exec

    Please help me to solve this issue.

    Best Regards,

  2. #2
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    You should execute the stored procedure first, store the outputvalue in a variable, and then insert the value of the variable in the table.
    I'm not crazy, I'm an aeroplane!

  3. #3
    Join Date
    Dec 2002
    Location
    Nepal
    Posts
    32
    But it is returning more than 5 column and 10 rows. i will appriciate if you could give a simple code hint.

    Thank You

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    define a proxy table on the proc

Posting Permissions

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