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 are ddl (data definition language) statements for tables in ms sql server?
Which data types generate inaccurate results if used with an = or <> comparison in a where clause of a sql statement?
Explain about system stored procedure?
What does COMMIT command do?
What are the types of sql server?
Difference between DELETE and TRUNCATE?
How do we Backup SQL Azure Data?
What is the difference between local and global temporary tables?
What is the usage of sign function?
can you implement data mining in SSRS?
What is sub query and its properties?
How to join two tables in a single query in ms sql server?
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?
What are trace flags and mention a few common trace flags used with sql server?
How do I create a partition table in sql server?