Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I convert Trigger used in Oracle to SQL-Server

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hallo,

I'd like to convert trigger formerly used in an Oracle DB to SQL-Server. In Oracle you can usually use the function
"Create package..." and
"Create Package body...".

Is there any similar functionality in SQL-Server that I can use?

Thank's a lot
Roger
 

See Create Trigger in SQL books online. The syntax is as follows.

Syntax
CREATE TRIGGER trigger_name
ON table
[WITH ENCRYPTION]
{
{FOR { [DELETE] [,] [INSERT] [,] [UPDATE] }
[WITH APPEND]
[NOT FOR REPLICATION]
AS
sql_statement [...n]
}
|
{FOR { [INSERT] [,] [UPDATE] }
[WITH APPEND]
[NOT FOR REPLICATION]
AS
{ IF UPDATE (column)
[{AND | OR} UPDATE (column)]
[...n]
| IF (COLUMNS_UPDATED() {bitwise_operator} updated_bitmask)
{ comparison_operator} column_bitmask [...n]
}
sql_statement [ ...n]
}
} Terry
------------------------------------
Blessed is the man who, having nothing to say, abstains from giving us worthy evidence of the fact. -George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top