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 are ddl (data definition language) statements for tables in ms sql server?

1080


Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?

1038


Explain about system stored procedure?

1018


What does COMMIT command do?

1037


What are the types of sql server?

1034


Difference between DELETE and TRUNCATE?

1034


How do we Backup SQL Azure Data?

108


What is the difference between local and global temporary tables?

1127


What is the usage of sign function?

1081


can you implement data mining in SSRS?

146


What is sub query and its properties?

964


How to join two tables in a single query in ms sql server?

979


Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

1021


What are trace flags and mention a few common trace flags used with sql server?

1071


How do I create a partition table in sql server?

1090