Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

trigger when a specific column gets updated Expand / Collapse
Author
Message
Posted Wednesday, December 5, 2012 3:21 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, December 4, 2014 4:34 AM
Points: 233, Visits: 739
Hi Team,




It's my first time to use triggers so Is there a way to create a trigger when a specific column gets
updated or inserted (not the whole table)?
Post #1392880
Posted Wednesday, December 5, 2012 3:35 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
Same as this topic

http://www.sqlservercentral.com/Forums/Topic1392869-391-1.aspx




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1392886
Posted Wednesday, December 5, 2012 6:32 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, August 16, 2013 8:28 AM
Points: 249, Visits: 460
Minnu,

Please stop posting the same question worded differently multiple times. It wont get an answer any faster.

Post #1392974
Posted Wednesday, December 5, 2012 7:40 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 8:58 PM
Points: 35,792, Visits: 32,473
Minnu (12/5/2012)
Hi Team,
It's my first time to use triggers so....?


So... From SSMS, press the F1 key to get into Books Online. Then search for CREATE TRIGGER and start reading. I'm not being sarcastic here. If it's truly your first time, take the opportunity to teach yourself all about triggers so you won't have to ask such questions in the future. To really do it right, create a test database and some tables to practice writting triggers on so you can actually see what they do.

Triggers can be quite the tripping point in code and if you don't have a very firm grasp on what they actually do and how they work and how to use them, you're going to make some really huge and embarassing mistakes.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1393007
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse