Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

WHAT IS TRIGGERS IN SQL? AND WHAT IS THE BENIFIT?

Answer Posted / mallika

Triggers are the system generated events.
for example,
u have a table emp,in tat u can create a trigger which will
be activated if anyone performs any action such as insert,
update, delete on tat table.In tat trigger u can write code
which copies the updated info into another table.
we can provide security to the data by mentioning before
clause in tat trigger by which we can restrict the
modifications anyone can make to our table.

CREATE TRIGGER DelhiDel ON [Customers]
FOR DELETE
AS
IF (SELECT state FROM deleted) = ‘Delhi’
BEGIN
PRINT ‘Can not remove customers from Delhi’
PRINT ‘Transaction has been canceled’
ROOLBACK
END

Is This Answer Correct ?    46 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between locking and multi-versioning?

989


Is it true, that there is no difference between a rule and a check constraint?

1057


Which command is used for user defined error messages?

1060


where can you add custom error messages to sql server? : Sql server administration

1120


what are the different stages of Report Processing?

135


How do I connect to sql server database?

1013


Does full backup break log chain?

962


How do I uninstall sql server 2014?

935


What are different types of roles provided by ssrs?

150


How to change the name of a database user?

960


is there a column to which a default can't be bound? : Sql server database administration

1015


Do you know clustered and non-clustered index?

979


What are the different types of locks in the database?

925


How can sql injection be stopped? : sql server security

1037


How to use clusters?

945