Hw to execute stored procedure using select statement?

  • I have execute my stored procedure using a select statement like

    Exec SP where select * from view,wt is the finall out put of this query can some one tell me the answer,,

    And one more thing is have to manipulate the Temprory tables,Is it manipulate the temprory tables ,but how some one tell me the answer with an example

  • I think you should use Table Valued Parameter. The below link has examples in it too.

    http://blog.sqlauthority.com/2008/08/31/sql-server-table-valued-parameters-in-sql-server-2008/

  • nareshmsbi13 (5/8/2013)


    I have execute my stored procedure using a select statement like

    Exec SP where select * from view,wt is the finall out put of this query can some one tell me the answer,,

    And one more thing is have to manipulate the Temprory tables,Is it manipulate the temprory tables ,but how some one tell me the answer with an example

    you will need to create a temporary table to capture the stored proc results: you have to know the datatypes to build your table beforehand:

    CREATE TABLE #tmp(

    view varchar(30),

    wt varchar(30) )

    --insert the results into the properly shaped temp table

    INSERT INTO #tmp

    EXEC pr_MyProcedure @Param = 42

    SELECT * FROM #tmp

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 3 posts - 1 through 2 (of 2 total)

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