Home arrow SQL Server arrow Using Triggers In MS SQL Server
SQL SERVER

Using Triggers In MS SQL Server


Triggers allow us to execute a batch of SQL code when either an insert, update or delete command is executed against a specific table. In this article David will describe exactly what triggers are, he will show you how to create new triggers from scratch, how to test triggers, and also provide you with some valuable links/books to help you learn more about triggers.

Author Info:
By: David Rusik
Rating: 4 stars4 stars4 stars4 stars4 stars / 593
January 01, 2002
TABLE OF CONTENTS:
  1. · Using Triggers In MS SQL Server
  2. · What exactly is a trigger?
  3. · UPDATE and DELETE triggers
  4. · Conclusion

print this article
SEARCH DEVARTICLES

Using Triggers In MS SQL Server
(Page 1 of 4 )

Designing a database for a large-scale web application is a monstrous task to say the least. It can however, be made easier by taking full advantage of the many tools, utilities and built-in objects that come with a Relational Database Management System (RDBMS), such as Microsoft SQL Server 7/2000.

One of these objects that many developers overlook is the trigger. Triggers are "attached" to a table and allow us to setup our database in such a way that whenever a record is added, updated, or deleted from a table, then SQL server will automatically execute a batch of SQL code after that table modification takes place.

We can do some really powerful things with the help of triggers. In this article I will describe exactly what triggers are, show you how to create new triggers from scratch, how to test those triggers, and also provide you with some valuable links/books to learn more about triggers.

To play around with the code in this article, you will need access to a computer running Microsoft SQL Server 7/2000. You should also be familiar with the structured query language (SQL). If you don’t have SQL Server, you can download a 120-day evaluation copy from http://www.microsoft.com/sql/downloads/default.asp.
blog comments powered by Disqus
SQL SERVER ARTICLES

- Executing SQL Server Stored Procedure from P...
- How to Search for Date and Time Values Using...
- Replication: SQL Server 2000 - Part 2
- Replication: SQL Server 2000 - Part 1
- SQL Sever: Storing Code in Binary or Text Fi...
- Execute SQL on Multiple Tables/Columns - New...
- How to Connect to a SQL Server from Visual F...
- SQL Server Hardware Tuning and Performance M...
- Primary Key on Multiple Tables – New RDBMS C...
- Migrating from Sybase to SQL Server
- What's Best for DBAs? GUI or T-SQL Comma...
- How to Perform a SQL Server Performance Audit
- An Introduction To The Bulk Copy Utility
- SQL Server Stored Procedures 101
- Building Your First SQL Server 2000 Database

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials