Showing posts with label Sql Server 2008. Show all posts
Showing posts with label Sql Server 2008. Show all posts

How to execute Sql Server Agent job from Trigger

if you want to trigger the job on database insert,update and delete operation then you want to write the trigger in the way below:


CREATE TRIGGER TriggerName
ON TableName
AFTER INSERT, UPDATE, DELETE
AS
EXEC msdb..sp_start_job
@job_name = 'JobName';
GO

you need to only replace 'JobName' with your create job.



Cheers...

I installed it but I don't see where I can open it.

Click on the Windows Start button, click on the "Run" option and try to run the following command:

-> ssms.exe



Cheers....