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
What is the difference between locking and multi-versioning?
Is it true, that there is no difference between a rule and a check constraint?
Which command is used for user defined error messages?
where can you add custom error messages to sql server? : Sql server administration
what are the different stages of Report Processing?
How do I connect to sql server database?
Does full backup break log chain?
How do I uninstall sql server 2014?
What are different types of roles provided by ssrs?
How to change the name of a database user?
is there a column to which a default can't be bound? : Sql server database administration
Do you know clustered and non-clustered index?
What are the different types of locks in the database?
How can sql injection be stopped? : sql server security
How to use clusters?