Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to store store procedure records into table

Author  Topic 

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2011-07-19 : 12:48:03
Hi All
I am trying to populate the store procedure result into my #temp table


INSERT INTO #TEMP EXEC msdb..sp_help_job

but I am getting below error msg .Please suggest


Msg 8164, Level 16, State 1, Procedure sp_get_composite_job_info, Line 72
An INSERT EXEC statement cannot be nested.
Msg 8114, Level 16, State 1, Procedure sp_get_composite_job_info, Line 269
Error converting data type nvarchar to int.

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-07-19 : 13:24:32
You insert/exec because sp_help_job does.

Execute sp_help_job to see what it does, make your own sp to do what you need.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-07-20 : 07:23:59
you can directly use catalog views like sysjobs,sysjobhistory etc to get details of job rather than calling sp_helpjob

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -