stored proc and view

  • Hello,

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

    thank's

  • 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.

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

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

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