|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Job Outcome Constants (SQLDMO_JOBOUTCOME_TYPE)How can i write a simple procedure as below, call it from a job, and because
@m = 2 it will fail the job step and so show me the red x beside the job name in ent mgr? create procedure marc1 as declare @m int set @m = 2 if @m = 1 begin print '2' end else begin print '2' return -1 end marcmc wrote:
Show quote > How can i write a simple procedure as below, call it from a job, and because Use RAISERROR:> @m = 2 it will fail the job step and so show me the red x beside the job name > in ent mgr? > > create procedure marc1 as > > declare @m int > set @m = 2 > if @m = 1 > begin > print '2' > end > else > begin > print '2' > return -1 > end e.g. RAISERROR('My error message', 16, 1) |
|||||||||||||||||||||||