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

Run Trigger 'As Usr1'

Status
Not open for further replies.

drdb

Programmer
May 22, 2003
9
NG
Is there a way to fire a trigger 'as a user'.

The problem is when a database (database1) is updated using an application role it attempts to fire a trigger which is modifying or adding a record to another database (database2). This works OK in query analyser, but when run under the program an exception is raised \\domainuser\userid is not a authorized user in database2

I am looking for a way to force a standard user login to fire the trigger as, is this possible??
 
It's not possible, otherwise people would be able to get any rights just by adding a few lines to their sql queries.

I've ran into a problem like this before. The solution was to create a job, that would run under user sa, that would process all the newly inserted or recently updated data. In other words, apply your trigger logic to a sql job.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top