Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

writing a basic trigger in SQL 2005

Posted on 2011-02-21
3
218 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
ID: 34944096
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
ID: 34944105
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
ID: 34944114
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

840 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