April 16, 2008 at 7:11 am
I'm having a strange issue when a Instead of Update trigger is fired. I'm connecting to the database with a user of FirstUser. When the trigger is fired, it is firing with under the user of DBO. I see the user via the CURRENT_USER function printed in the trigger. When I look in Profiler, I see the LoginName of FirstUser.
What would be causing the trigger to fire under DBO user when the FirstUser ID is the one performing an update on the table?
Thanks,
Kyle
April 16, 2008 at 8:07 am
I have not tested it or really researched it, but odds are the trigger is firing using the ownership chain so you are getting DBO. LoginName in profiler is probably returning the value from suser_name()
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
April 16, 2008 at 9:01 am
Okay,
This morning I backed up the "bad" database and restored it on another server. My program ran just fine.
Then a backed up the "good" database that I restored from the "bad" one as above, and restored the "good" on onto the "bad" server - and my program failed.
So it appears that there is something with the "bad" SQL Server. Any suggestions on how to diagnose differences between SQL servers?
Thanks,
Kyle
April 16, 2008 at 9:27 am
What is it you are trying to accomplish? When you say it failed, are you getting an error or just results different from what you expect?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply