Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Trigger Permissions??

Author  Topic 

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-01-29 : 17:39:13
A fellow developer is having a weird problem that I don't know the answer to. I hope someone can point me in the right direction here.

A Windows Authenticated user in SQL server can insert a row into a table, and the INSERT trigger on that table fires. A SQL authenticated user, can insert a row into the same table, but the trigger does not fire. Both users are DBO (yes yes, I know bad practice).

Why can't the SQL user fire the trigger??

Thanks!

Michael



<Yoda>Use the Search page you must. Find the answer you will.</Yoda>

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-01-29 : 17:42:01
So no error? It just doesn't fire? Is there any special logic in the trigger? Can you duplicate it with a different userid?

Tara
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-01-29 : 17:59:45
The trigger doesn't fire. There's nothing special in the trigger.

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-01-29 : 18:04:26
I can't think of anything that would cause this. Check out what is going on with SQL Profiler.

How do you know that the trigger doesn't fire? Can you modify the trigger so that it does a simple INSERT to prove that it is firing? My guess is that it is firing, it just isn't giving the desired results.

Tara
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-01-29 : 18:05:55
According to profiler, the "Windows" users fires the trigger, the "SQL" user does not. The Windows user puts a record in the desired table, and the "SQL" user does not.

I think that the SQL user just needs to be deleted and a new user created. Something is just "not right" with that user.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-01-29 : 18:31:06
Do you have any objects that are similarly named? Maybe one account is going against Owner1.ObjectName and the other is going against Owner2.ObjectName.

Tara
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-01-29 : 18:32:49
I think the developer in question is going to take your first suggestion and create a new user and see if he can duplicate it.

Thanks for all of your advice on this Tara!

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page
   

- Advertisement -