How to apply Trigger on Database?

Omniitstudent
Posted by Omniitstudent under Sql Server category on | Points: 40 | Views : 1266
CREATE TRIGGER LogNewTable
ON DATABASE
FOR CREATE_TABLE
AS
BEGIN
INSERT INTO dba.DatabaseOperation
VALUES(SUSER_SNAME(),
N'A new table was created', GETDATE())
END
----------
whenever new table is created in the current database and trigger get fired and name of the user who created the table ,date time the table was created .these information
stored in the logtable..

Comments or Responses

Login to post response