Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Triggers are created using the CREATE TRIGGER T-SQL command. A trigger is ultimately a collection of one or more lines of T-SQL code, so a GUI tool for the creation of triggers is really not practical. The good news is that the syntax used is rather simple. The following syntax is used for trigger creation:
CREATE TRIGGER trigger_name
ON { table | view | database | all server}
WITH dml_trigger_option>
{ FOR | AFTER | INSTEAD OF } { event }
AS
Insert T-SQL code starting here;
Like most CREATE statements, the first thing you do with CREATE TRIGGER is specify a name. Next, you should indicate the trigger level of table, view, database, or server. If the trigger level is a database, table, or view, you specify ON object_name. When the trigger level is the server, you simply specify ALL SERVER.