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
Can you explain important index characteristics?
What are the benefits and tasks of object explorer? : sql server management studio
What does the on delete cascade option do?
If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?
What are the new security features added in sql server 2012? : sql server security
What happens if null values are involved in string operations?
How to implement service broker?
How to change a login name in ms sql server?
explain different types of joins? : Sql server database administration
What is stored in the mssqlsystemresource database? : sql server database administration
List out the difference between union and union all in sql server?
Can we use trigger new in before insert?
What is row_number () and partition by in sql server?
How to declare a cursor with "declare ... Cursor" in ms sql server?
You have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem?