views:

209

answers:

3

Hello everyone,

I am using SQL Server 2008 and I want to test the execution correctness of my SQL Server Agent job immediately to ignore the schedule. Any ideas?

thanks in advance, George

+2  A: 
marc_s
Hi Marc, it is why I am confused. In SQL Server Management Studio it only has Start Job at Step... option, no Start Job option. Do you mean Start Job at Step... option?
George2
Yes, that's the option to start a job.
marc_s
If your job only has a single step (which I believe it has), the job will be started right away.
marc_s
If your job has several steps, you can pick which one to start at - that's why it has this "Start Job at Step...." captoin.
marc_s
Cool, question answered!
George2
+1  A: 

Create a stored procedure that encapsulates all the aspects of your job and then use that in SQL Agent. You can then just call the procedure from the command line to test it eg. exec dbo.MyProcedure @param1 = 'foo'

Dan Diplo
Hi Dan, it is just a walk-around. My purpose is I want to test all settings in SQL Server Agent Job, besides schedule. Storeprocedure is only a part of all SQL Server Agent Job settings, I need to test other parts. Any comments or ideas? :-)
George2
+1  A: 

Change the schedule to have it run five minutes in the future. Then get off the server so it runs in exactly the environment you want to test.

Wes Groleau