create update trigger with parameters mssql

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2007
Posts: 144
Reputation: emilio is an unknown quantity at this point 
Solved Threads: 0
emilio emilio is offline Offline
Junior Poster

create update trigger with parameters mssql

 
0
  #1
Feb 7th, 2009
hi
i want to create a trigger for update in mssql.

in my trigger i want to know which row was updated

how can i achieve this info ?
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 2,065
Reputation: Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice Ramy Mahrous is just really nice 
Solved Threads: 256
Featured Poster
Ramy Mahrous's Avatar
Ramy Mahrous Ramy Mahrous is offline Offline
Postaholic

Re: create update trigger with parameters mssql

 
0
  #2
Feb 7th, 2009
When you create trigger After AS play with columns_updated() function read in http://msdn.microsoft.com/en-us/libr...4(SQL.80).aspx
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3
Reputation: Doron_ is an unknown quantity at this point 
Solved Threads: 0
Doron_ Doron_ is offline Offline
Newbie Poster

Re: create update trigger with parameters mssql

 
0
  #3
Feb 15th, 2009
Use the "inserted" keyword in the trigger.

if you use inside the trigger code:

SELECT * FROM inserted

only the updated rows will be returned.
Doron Saar,

Nob Hill Software - tools for database people (+ free stuff!) Nob Hill Software - tools for database people (+ free stuff!)
www.nobhillsoft.com
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC