Mnior |
---|
Пример:USE msdb;
GO
DECLARE @JobID Int, @Result Int;
SELECT Top 1 @JobID = job_id FROM sysjobs WHERE name NOT IN ('My','favorite','jobs');
WHILE (@JobID IS NOT NULL) BEGIN
EXEC @Result = sp_delete_job @job_id = @JobID;
IF (@Result != 0) BREAK;
SELECT Top 1 @JobID = job_id FROM sysjobs WHERE name NOT IN ('My','favorite','jobs');
END
GO |
Дал следующее:
Server: Msg 206, Level 16, State 2, Line 2
Operand type clash: uniqueidentifier is incompatible with int
Server: Msg 206, Level 16, State 1, Line 6
Operand type clash: uniqueidentifier is incompatible with int
Если @JobID сделать uniqueidentifier, то очистил все не смотря на условие. Условие ('%568%') чтобы оставить что нужно!