create table job_server
(job_id varchar(100),
originating_server varchar(50),
name varchar(50),
enabled int ,
description varchar(100),
start_step_id int,
category varchar(100),
owner varchar(20),
notify_level_eventlog int,
notify_level_email int,
notify_level_netsend int,
notify_level_page int,
notify_email_operator varchar(100),
notify_netsend_operator varchar(100),
notify_page_operator varchar(100),
delete_level int,
date_created datetime,
date_modified datetime,
version_number int,
last_run_date varchar(100),
last_run_time varchar(100),
last_run_outcome int,
next_run_date varchar(100),
next_run_time varchar(100),
next_run_schedule_id int,
current_execution_status int,
current_execution_step varchar(500),
current_retry_attempt int,
has_step int,
has_schedule int,
has_target int,
type int
)
insert into pubs.dbo.job_server
(job_id,originating_server,name,enabled,description,start_step_id,category,owner,notify_level_eventlog,notify_level_email,notify_level_netsend,notify_level_page,notify_email_operator,
notify_netsend_operator,notify_page_operator,delete_level, date_created,date_modified,version_number,last_run_date,last_run_time,last_run_outcome,next_run_date,next_run_time,
next_run_schedule_id ,current_execution_status,current_execution_step, current_retry_attempt ,has_step,has_schedule, has_target, type )
EXEC msdb.dbo.sp_help_job
報錯誤信息;
Server: Msg 8164, Level 16, State 1, Procedure sp_get_composite_job_info, Line 67
An INSERT EXEC statement cannot be nested.
(job_id varchar(100),
originating_server varchar(50),
name varchar(50),
enabled int ,
description varchar(100),
start_step_id int,
category varchar(100),
owner varchar(20),
notify_level_eventlog int,
notify_level_email int,
notify_level_netsend int,
notify_level_page int,
notify_email_operator varchar(100),
notify_netsend_operator varchar(100),
notify_page_operator varchar(100),
delete_level int,
date_created datetime,
date_modified datetime,
version_number int,
last_run_date varchar(100),
last_run_time varchar(100),
last_run_outcome int,
next_run_date varchar(100),
next_run_time varchar(100),
next_run_schedule_id int,
current_execution_status int,
current_execution_step varchar(500),
current_retry_attempt int,
has_step int,
has_schedule int,
has_target int,
type int
)
insert into pubs.dbo.job_server
(job_id,originating_server,name,enabled,description,start_step_id,category,owner,notify_level_eventlog,notify_level_email,notify_level_netsend,notify_level_page,notify_email_operator,
notify_netsend_operator,notify_page_operator,delete_level, date_created,date_modified,version_number,last_run_date,last_run_time,last_run_outcome,next_run_date,next_run_time,
next_run_schedule_id ,current_execution_status,current_execution_step, current_retry_attempt ,has_step,has_schedule, has_target, type )
EXEC msdb.dbo.sp_help_job
報錯誤信息;
Server: Msg 8164, Level 16, State 1, Procedure sp_get_composite_job_info, Line 67
An INSERT EXEC statement cannot be nested.
EXEC 有限制
我以前也遇到过
只知道更改插入方式
不知道MS为什么这么限制