Use stored procedure result to insert into table

  • Silly question:

    my stored procedure returns one row. I need to insert the result to a table. Can I right something like that:

    =============

    Insert into table1

    exec myProc '1/1/15', 3/1/15'

    =====

    Or may be I can use Table-valued function insted of myProc?

    Thanks

  • valeryk2000 (3/25/2015)


    Silly question:

    my stored procedure returns one row. I need to insert the result to a table. Can I right something like that:

    =============

    Insert into table1

    exec myProc '1/1/15', 3/1/15'

    Yes

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Yes silly or yes I can?

  • valeryk2000 (3/25/2015)


    Can I right something like that:

    =============

    Insert into table1

    exec myProc '1/1/15', 3/1/15'

    Yes

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Solved. Thanks a lot.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply