Help, I can't get this to work:
declare @JobName nvarchar(100)
SET @JobName = 'XXX'
sp_add_jobstep
@job_name = @JobName,
@step_name = N'Run job step',
@subsystem = N'TSQL',
@command = N'EXEC Staging.dbo.test'
Error:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'sp_add_jobstep'.
THANKS
declare @JobName nvarchar(100)
SET @JobName = 'XXX'
sp_add_jobstep
@job_name = @JobName,
@step_name = N'Run job step',
@subsystem = N'TSQL',
@command = N'EXEC Staging.dbo.test'
Error:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'sp_add_jobstep'.
THANKS