urgent ....pls help..how to read variables values from a view and pass them to a stored procedure.

  • Hi,

    i have a stored procedure which has many parameters. 2 of its parameters values come from 2 columns in a view.

    stored proc parameters

    @USAANR int

    @claimopendate datetime

    view columns

    USAANR

    claimopendate

    i need to execute this procedure and before that take the parameters value from the columns of the view.

    i need to take all the rows of both the columns (there is no where condition)

    after this i need to load the results of the proc in a sql table.....

    please provide some solution...

    Thanks....

  • Can you rephrase that?;-)

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • It can be easily done but the performance will be poor. Your best option is to rework the stored procedure (or an alternative version of it, retaining the original) so that it reads from the view, rather than working with a row at a time using parameters.


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

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

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