• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 227
  • Last Modified:

writing a basic trigger in SQL 2005

I would like to create a trigger in a SQL 2005 database to run a table update script that I have created.  I would like the trigger to execute my update script whenever data is inserted or updated into the table.  It should not be very complicated.

Could someone please share with me the syntax on how to create such a trigger?  I'd be grateful.
0
apitech
Asked:
apitech
1 Solution
 
rushShahCommented:
try this.


CREATE TRIGGER reminder1
ON Sales.Customer
AFTER INSERT, UPDATE 
AS 
--Execute Your Update Script
GO

Open in new window

0
 
meko72Commented:
Here is some links I found that might help you.

http://msdn.microsoft.com/en-us/library/ms189799.aspx

http://msdn.microsoft.com/en-us/library/ms190273.aspx

http://ss64.com/sql/   ( 2005 Sql Commands A-Z)

Hope this helpds
0
 
rocky_lotus_newbieCommented:
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now