CURSORS

DECLARE cursor_name CURSOR [LOCAL | GLOBAL] [FORWARD_ONLY | SCROLL] [STATIC | KEYSET | DYNAMIC | FAST_FORWARD]
FOR select_statement[FOR UPDATE [OF column_name [,...n]]]

OPEN SYNTAX

OPEN { { [GLOBAL] cursor_name } | cursor_variable_name}

FETCH SYNTAX
FETCH [ NEXT | PRIOR | FIRST | LAST|ABSOLUTE n ] | RELATIVE n ] FROM { [GLOBAL]cursor_name|@cursor_variable_name } [INTO @variable_name[,...n] ]

CLOSE SYNTAX
CLOSE { { [GLOBAL] cursor_name } | cursor_variable_name }

TRIGGERS

Creating AFTER Trigger
CREATE TRIGGER trigname ON tablename AFTER INSERT [,UPDATE][,DELETE] AS BEGIN ……. ……. END

Creating INSTEAD OF Triggers
CREATE TRIGGER trigname ON tablename/viewname INSTEAD OF INSERT [,UPDATE][,DELETE] AS BEGIN …….. ……….. END

DDL Trigger
CREATE TRIGGER trigname ON DATABASE AFTER CREATE_objtype [,ALTER_objtype] [,DROP_objtype] AS BEGIN …….. ……… END

Sign up to vote on this title
UsefulNot useful