Do you need a unique name for a trigger?
Trigger names do not need to be unique with respect to other schema objects, such as tables, views, and procedures. For example, a table and a trigger can have the same name (however, to avoid confusion, this is not recommended). When Is the Trigger Fired?
What is the create trigger statement in SQL Server?
Introduction to SQL Server CREATE TRIGGER statement. The CREATE TRIGGER statement allows you to create a new trigger that is fired automatically whenever an event such as INSERT, DELETE, or UPDATE occurs against a table. The following illustrates the syntax of the CREATE TRIGGER statement: The schema_name is the name of the schema to which
How to determine if insert or update trigger?
So you can use something like IF EXISTS (SELECT * FROM DELETED) to detect an update. You only have rows in DELETED on update, but there are always rows in INSERTED. Look for “inserted” in CREATE TRIGGER. After comment, this answer is only for INSERTED and UPDATED triggers.
What do you need to know about triggers?
Topics include: Designing Triggers Creating Triggers Coding the Trigger Body Compiling Triggers Modifying Triggers Enabling and Disabling Triggers Viewing Information About Triggers Examples of Trigger Applications Responding to System Events through Triggers Designing Triggers Use the following guidelines when designing your triggers:
What happens when a trigger is not compiled?
A trigger is compiled when it is created. Thus, if a remote site is unavailable when the trigger must compile, then Oracle Database cannot validate the statement accessing the remote database, and the compilation fails. The previous example exception statement cannot run, because the trigger does not complete compilation.
Can a table and trigger have the same name?
Trigger names must be unique with respect to other triggers in the same schema. Trigger names do not need to be unique with respect to other schema objects, such as tables, views, and procedures. For example, a table and a trigger can have the same name (however, to avoid confusion, this is not recommended).