Solved

writing a basic trigger in SQL 2005

Posted on 2011-02-21
3
215 Views
Last Modified: 2012-05-11
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
Comment
Question by:apitech
3 Comments
 
LVL 8

Accepted Solution

by:
rushShah earned 500 total points
Comment Utility
try this.


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

Open in new window

0
 
LVL 9

Expert Comment

by:meko72
Comment Utility
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
 
LVL 4

Expert Comment

by:rocky_lotus_newbie
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now