Friday, December 5, 2008

Triggers

Triggers:

============== SQL Server 2005=====================

 

IF OBJECT_ID ('dbo.trEmployee', 'TR') IS NOT NULL

   DROP TRIGGER dbo.trEmployee

GO

CREATE TRIGGER trEmployee

ON Practice.dbo.Employee

AFTER INSERT, UPDATE

AS

update employee set triggerdate=getdate()

GO

=============================================

 

============== SQL Server 2000=====================

 

IF OBJECT_ID ('Sales.reminder1', 'TR') IS NOT NULL

   DROP TRIGGER Sales.reminder1

GO

CREATE TRIGGER reminder1

ON Sales.Customer

AFTER INSERT, UPDATE

AS RAISERROR ('Notify Customer Relations', 16, 10)

GO

 

============================================

 

In the above Two examples 'Sales.reminder1' where as ‘Sales’ is the Database and ‘reminder1’ is the table name and 'TR' is the Trigger.The object_ID will return the integer.If any trigger is there You are telling to drop the trigger and then Create trigger triggername on (databaseobject(dbo).table) this is in sql server 2005 and (database.table) this is in sql server 2000.After the which event u want to fire the trigger like insert,update(dml) as where u want to save the trigger in the table.

 

Here the result after the update or insert the trigger event will fire and save in to system triggers in the same table.

Languages with object-oriented features


§                     ABAP

§                     Ada 95

§                     BETA

§                     Blue

§                     Boo

§                     C++

§                     C#

§                     COBOL

§                     ColdFusion

§                     Common Lisp

§                     COOL (Object Oriented COBOL)

§                     CorbaScript

§                     Clarion

§                     CLU

§                     Curl

§                     D

§                     Object Pascal (Borland Delphi)

§                     Dylan

§                     E

§                     Eiffel

§                                 Sather

§                     F-Script

§                     F#

§                     Fortran 2003

§                     Gambas

§                     Graphtalk

§                     IDLscript

§                     incr Tcl

§                     J

§                     JADE

§                     Java

§                                 Groovy

§                                 Join Java

§                                 X10

§                     Lasso

§                     Lava

§                     Lexico

§                     Lingo

§                     Modula-2

§                    Modula-3

§                     Moto

§                     Nemerle

§                     NetRexx

§                     Oberon (Oberon-1)

§               Oberon-2

§                     Object REXX

§                     Objective-C

§                     Objective Cam

§                     Oz

§                     Mozart Programming System

§                     Perl 5

                 PHP

§                     Pliant

§                     PRM

§                     Prototype-based languages

§                                 Actor-Based Concurrent Language, ABCL: ABCL/1, ABCL/R,ABCL/R2, ABCL/c+

§                                 Agora

§                                 Cecil

§                                 Cel

§                                 ECMAScript

§                                             ActionScript

§                                             JavaScript

§                                             JScript

§                                 Etoys in Squeak

§                                 Io

§                                 Lua

§                                 Lisaac

§                                 MOO

§                                 NewtonScript

§                                 Obliq

§                                 REBOL

§                                 Self

§                     Python

§                     REALbasic

§                     Revolution

§                     Ruby

§                     Scala

§                     Simula

§                     Smalltalk

§                                 Self

§                                 Bistro

§                                 Squeak

§                     S (programming language)

§                                 R (programming language)

§                     Squirrel

§                     Superx++

§                     TADS

§                     Ubercode

§                     Visual Basic

§                                 VB.NET

§                                 VBScript

§                                 VBA

§                     Visual FoxPro

§                     Visual Prolog

§                     Tcl

§                                 Xotcl similar to CLOS

§                                 Snit uses delegation

§                                 itcl similar to C++

§                     XBase_plus_plus Extends xBase Standard Language

§                     ZZT-oop