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 latest version of microsoft sql server?

1038


What is unique key constraint?

1045


What is a select query statement in ms sql server?

1067


Does sql server use t sql?

1011


Tell me what is sql profiler?

1020


Why main is user defined function?

1006


how to create “alternate row colour”?

146


Do I need a report server to run reports in my application?

165


what is the difference between openrowset and openquery?

1077


What is difference between oltp and olap?

1032


How can you insert values in multiple rows using one Insert statement?

1089


What are the different ways you can create databases in sql server?

1097


Name and describe few console utilities for ssrs?

284


What happens when the SQL Azure database reaches Max Size?

111


What are the difference between data mart and data warehouse? : sql server analysis services, ssas

954