Index -> About Us -> Privacy Policy -> Terms & Conditions -> Place Your Link -> Add Your Article
Search:   
leotallboy.com leotallboy.com
 

Simulation Software

The world behind a virtually simulated world is that of simulation software. Simulation software is ... - Elizabeth Morgan
 

Why Should I Bother With Optimised Online Copywriting?

It's no good having a creative, individual website with brilliant, informative copy if customers can ... - Jackie Griffiths
 

Mortgage Banking Software

Mortgage banking software can be useful to people who are looking into buying a home. This software ... - Kristy Annely
 
 

How I Suddenly Stumbled Onto No.1 In Google and Yahoo Without Search Engine Optimization - So What?

I hope not a single SEO webmaster will read this issue. That's because, in a way, it's outrageous! I ... - Valeriu Popescu
 

You'll Just Love the Way this 5 Step System Will Boost Up Your Website Profits

You Can't Make Serious Profits From Your Website Until You Obey these 5 Simple Steps. - Murtuza Abbas
 

Get Connected To Wi-Fi

Wi-Fi, short for wireless fidelity refers to a set of wireless networking technologies more specific ... - Robert Thatcher
 

How One Joint Venture Deal Could Pay You Forever

Would you like to get paid forever from one joint venture deal, instead of just earning a one time p ... - Joseph Pattison
 

Chiropractic Software

Just like almost every aspect of life and every branch of medicine, technology is stretching its rea ... - Kevin Stith
 
 

Index › Computers & Software › Website Development
 

SQL Server Triggers

 
Author: Chris Kemp

Triggers are stored procedures which are fired when data is modified in an underlying table. They can evaluate data being added to a table for validation purposes, or can make changes in that or other fields depending on the value of that data. You can use them even to execute a separate stored procedure, or to roll back a data modification or an entire transaction.

In earlier versions of SQL Server, triggers were used to maintain referential integrity. In current versions, constraints and foreign keys are used to accomplish much of those tasks, but triggers are still used to accomplish more complex tasks than that are available to the built in newer tools, such as complex column constraints, evaluation of tables in other databases, complicated defaults, or cascading routines involving multiple changes in multiple tables.

Triggers are created in the Enterprise Manager, or in the Query Analyzer through the object browser. There are also templates for triggers in the Query Analyzer (Edit|Insert Trigger). Triggers can be created with the following syntax:

CREATE TRIGGER trigger_name
ON { table | view }
[ WITH ENCRYPTION ] {

{ { FOR | AFTER | INSTEAD OF } { [ INSERT ] [ , ] [ UPDATE ] }

[ WITH APPEND ]

[ NOT FOR REPLICATION ]

AS

[ { IF UPDATE ( column )

[ { AND | OR } UPDATE ( column ) ]

[ ... n ]

| IF ( COLUMNS_UPDATED ( ) { bitwise_operator } updated_bitmask )

{ comparison_operator } column_bitmask [ ... n ]

} ]

sql_statement [ ... n ]

} }

There are two types of triggers: AFTER and INSTEAD OF. After triggers AFTER TRIGGERS fire after the data is changed, either by insert, delete, or update. If the data is inappropriate, as defined in the trigger, the modification can be rolled back to where it was before the data was modified. After triggers AFTER TRIGGERS cannot be placed on views, and cannot be used on more than one table. Also, the text, ntext, and image columns cannot be referenced in an after trigger. AFTER TRIGGERS.

After triggers AFTER TRIGGERS can be nested to 32 levels deep, and can be called recursively, again to 32 levels.

Instead of INSTEAD OF triggers make the validation before the modification. However, Instead of INSTEAD OF triggers CAN can be used on views. They do not allow recursion, and you can only have one Instead of INSTEAD OF trigger per table. And you cannot use an Instead of INSTEAD OF trigger with a cascade.

Resources

Information on Constraints and Triggers

This resource discusses about constraints and triggers in detail.

Information: Create Trigger

This resource is useful in understanding the workings of triggers in detail.

Metro NY / NJ SQL Server Consultants
We specialize is custom database software. Call us for a free consultation (973) 635 0080 or email us at paladn.com

Author Bio:
Chris Kemp is a eminent columnist. Chris likes to write articles about this subject.
You can search for this article using: SQL Server Triggers, Computers & Software, Website Development, web page development
 
 
 

Related Articles

 
The General Ledger and Accounting Software
 
SQL Server Triggers
 
Time Clock Software
 
Website Promotion Plan - A Key To Success Of A Site
 
Fax Software
 
Photography Has Now Become Easier With Nokia N73
 
The Contrast And Similarities Between A Web Designer And Web Programmer
 
Free Competition Analysis for E-Commerce Startup
 
5 Knock-Out Strategies For Web Marketing Success In 2006
 
Climb Thousands of Search Engine Positions in Minutes
 
 
 

 

Recreation & Entertainment

 

Society & Communities

 

Computers & Software

 

Self Enhancement

 

Finance & Banking

 

Issues & News

 

Indoor Games

 

Healthcare & Treatment

 

Health & Therapy

 

Fashion & Relationships

 

Government & Politics

 

Shopping Online

 

Jobs & Careers

 

Tour & Travel

 

Home & Garden

 

Education & Reference

 

Vehicles & Automotive

 

Teens & Children

 

Drink & Food

 

Property & Agents

 

Culture & Art

 

Adventure & Sports

 

Science & Research

 

Companies & Business

 
   Index -> Privacy Policy -> Terms & Conditions
© 2006 www.leotallboy.com - All Rights Reserved Worldwide