February 27, 2010 at 11:39 pm
Hi,
i have no problem with using trigger in Oracle, but here with Sql Server 2005 Express Edition i am unable to write properly trigger body. Please give me syntax for getting newly inserted values and old values in a row of a table.
Thankx
February 28, 2010 at 12:10 am
This online article from the Microsoft documentation Books Online (BOL), explains it better than I ever could: http://msdn.microsoft.com/en-us/library/ms191300(SQL.90).aspx
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
February 28, 2010 at 11:55 am
RBarryYoung (2/28/2010)
This online article from the Microsoft documentation Books Online (BOL), explains it better than I ever could: http://msdn.microsoft.com/en-us/library/ms191300(SQL.90).aspx
Unfortunately the sample code given in that link is a truly bad example of worst practice for triggers because it won't work reliably if more than one row is affected. I strongly suggest you ignore it and read these examples instead:
February 28, 2010 at 3:12 pm
David Portas (2/28/2010)
RBarryYoung (2/28/2010)
This online article from the Microsoft documentation Books Online (BOL), explains it better than I ever could: http://msdn.microsoft.com/en-us/library/ms191300(SQL.90).aspx
Unfortunately the sample code given in that link is a truly bad example of worst practice for triggers because it won't work reliably if more than one row is affected. I strongly suggest you ignore it and read these examples instead:
http://msdn.microsoft.com/en-us/library/ms189799.aspx%5B/quote%5D
Yikes! :w00t: Right you are, Dave, good catch. I should have read the example more closely before posting that link, thanks for the save. 🙂
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
February 28, 2010 at 10:05 pm
Hi,
really i was confused with the example, as i am new to trigger in SqlServer .Thanks for information.
September 1, 2011 at 8:01 am
David Portas (2/28/2010)
RBarryYoung (2/28/2010)
Unfortunately the sample code given in that link is a truly bad example of worst practice for triggers because it won't work reliably if more than one row is affected. I strongly suggest you ignore it and read these examples instead:
http://msdn.microsoft.com/en-us/library/ms189799.aspx%5B/quote%5D
Nice Link 😉
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply