stored proc and view

  • iliadhe

    Old Hand

    Points: 304

    Hello,

    is there somone who know how to create a view with a stored procedure

    thank's

  • don1941

    SSCarpal Tunnel

    Points: 4183

    If you are wanting to create a view from the output of a stored procedure, I don't know of any way to do that. If you want to write a stored proc that creates a view, you could but why would you want to?

    To get the output of a stored proc into a table, you can do something like this:

    create table #j (

    job_id uniqueidentifier,

    job_name varchar(80),

    run_status int

    , run_date int,

    run_time int,

    run_duration int,

    operator_emailed int

    ,operator_netsent int,

    operator_paged int

    ,retries_attempted int

    ,server varchar(30)

    )

    insert into #j

    exec msdb..sp_help_jobhistory

    but you need to know the type of each output column.

  • Antares686

    SSC Guru

    Points: 125444

    What specifically are you doing and what are the expected results?

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

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