Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Which is better SQL JOB or Trigger

Author  Topic 

wizkid
Starting Member

3 Posts

Posted - 2003-03-07 : 08:14:46
Hi all,

I wanted to know which one is better ..Job or trigger.

I am in a situation where there is already a Job created and is running.
Now i need to transfer the update done by this Job to another table.
I have two options in front of me..
1. Modify the exisitng Job
2. Create a trigger in the affected table and transfer the value to the new table.

So i need help here from you Brainees. I feel it is worth a discussion.

Thanks,
Kido

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-03-07 : 08:20:49
A trigger will fire on any update dml, not just the ones in the job. Is that the biz rule or not?

Jay White
{0}
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-03-07 : 08:30:24
If you have the job running, then what better to know when the job has finished than the jonb itself.

In your case, I would use the job to transer data.

Damian
Go to Top of Page

wizkid
Starting Member

3 Posts

Posted - 2003-03-07 : 08:32:37
Hi Page 47,

In this case, i can use a trigger based on the Field updated right.?

Regards.
Kido

Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-03-07 : 08:34:29
No you can use a trigger based on the table. Then in your trigger, determine if you need to do anything.
Read Books online for more on triggers.

But I would still use the job, makes the most sense.

Damian
Go to Top of Page

wizkid
Starting Member

3 Posts

Posted - 2003-03-07 : 08:37:47
Hi Merlin,

Thanx.. i saw ur reply a little late.. I think i better follow urs and page47s opinions..

thanks buddies..

Go to Top of Page
   

- Advertisement -