Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Introduction to SQL Server CREATE TRIGGER statement The statement allows you to create a new trigger that is fired automatically whenever an event such as
Introduction to SQL Server CREATE TRIGGER statement The statement allows you to create a new trigger that is fired automatically whenever an event such as , or occurs against a table. The following illustrates the syntax of the statement: CREATE TRIGGER [schema_name.]trigger_name ON table_name AFTER {[ INSERT], [UPDATE], [DELETE] } [NOT FOR REPLICATION] AS \{sql_statements In this syntax: - The is the name of the schema to which the new trigger belongs. The schema name is optional. - The is the user-defined name for the new trigger. - The is the table to which the trigger applies. - The event is listed in the clause. The event could be, or A single trigger can fire in response to one or more actions against the table. - The option instructs SQL Server not to fire the trigger when data modification is made as part of a replication process. - The is one or more Transact-SQL used to carry out actions once an event occurs. Q1) create a trigger that will track changes happening to the database (After inserting and after updating Salary)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started