I’m trying to have a trigger set up in an arbitrary database that will store information in a specific database on execution. However, I found that if the trigger is triggered by someone without explicit access to that database, the trigger execution will fail.
I was hoping to find away around this using:
CREATE TRIGGER [myTrigger]
on database
with execute as 'UserWithPermissions'
but that doesn’t seem to work either… Does anyone know if this is possible? Any pointers would be greatly appreciated. Thanks.
In MSSQL Management go to DB-name => Security => Users and make sure the user has access. Also, Windows Network Authentication helps a lot when running procs from other machines
— edit —
I think what you want is called ‘EXECUTE AS’.