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 2005 Forums
 Transact-SQL (2005)
 Database Triggers

Author  Topic 

jgrant
Yak Posting Veteran

69 Posts

Posted - 2007-08-16 : 15:00:18
I am not very familiar with triggers. I was wondering if its possible to use a trigger to determine when a column of a particular row and table is altered or updated to then grab another piece of data from that same record and then call another sp?

The Yak Village Idiot

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-08-16 : 15:03:54
Yes, it is possible. But Triggers may affect multiple records, while chances are your Sproc is set up to deal with only one at a time. So I would advise copying the logic from your sproc into the trigger instead, always being mindful that your code must support multi-record transactions.

e4 d5 xd5 Nf6
Go to Top of Page

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-16 : 15:04:55
use books online. search for triggers. there are many examples to learn from

Ashley Rhodes
Go to Top of Page

jgrant
Yak Posting Veteran

69 Posts

Posted - 2007-08-16 : 15:42:25
Okay, thanks for the posts. I will try that.

The Yak Village Idiot
Go to Top of Page

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-16 : 15:45:26
The Yak Village Idiot

Thats Funny and Innovative..........

Ashley Rhodes
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-08-16 : 15:46:47
> The Yak Village Moron Sounds Better

ouch!

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-08-16 : 16:01:03
We already have a village idiot

http://www.sqlteam.com/forums/pop_profile.asp?mode=display&id=7101



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

ashley.sql
Constraint Violating Yak Guru

299 Posts

Posted - 2007-08-16 : 16:11:55
Too bad I can't see his picture. You can change yours to MORON

Ashley Rhodes
Go to Top of Page
   

- Advertisement -