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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Trigger

Status
Not open for further replies.

craig322

MIS
Apr 19, 2001
108
0
0
US
Has anyone written a trigger that will do something ONLY if a specific user is the person performing an action?

For example, I want to set up a trigger that if one person inserts a row into a table, that it will process that row. If anyone else inserts a row, it won't do anything.

Ideally this would be nice if it could actually look at specific roles and not users, but I can live with either.

TIA
 
hi

Yes you can do that. For that you have to write the when clause before the begin. You may trap the 'user' values to check if it is the user you want to track down. And when clause will make sure that this trigger , although it is on DML stmt on a particular table, it will still check the when clause to further restrict the execution of the trigger.

abhivyakti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top