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 Development (2000)
 Insert Trigger On SysUsers?

Author  Topic 

simondeutsch
Aged Yak Warrior

547 Posts

Posted - 2002-01-17 : 13:35:19
Hiya,
I'd like to have something like an insert trigger on sysusers/logins so that if a new user/login is added to my database, I can insert a row into a preferences table with default preferences for this user. The SysUsers table gives an error: Permission denied for create trigger... (I log in as SA. That's not the prob)

Sarah Berger MCSD

Lazer
Starting Member

8 Posts

Posted - 2002-01-17 : 13:57:18
As of my knowledge you cannot edit or do anything to a system table no matter under which user name you log in.
quote:

Hiya,
I'd like to have something like an insert trigger on sysusers/logins so that if a new user/login is added to my database, I can insert a row into a preferences table with default preferences for this user. The SysUsers table gives an error: Permission denied for create trigger... (I log in as SA. That's not the prob)

Sarah Berger MCSD



Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-01-17 : 13:59:25
How about this?

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=12134

Something similar could work for you.

Go to Top of Page

simondeutsch
Aged Yak Warrior

547 Posts

Posted - 2002-01-17 : 14:17:15
Hiya,
Is it sensible to run a job every 5 minutes when most likely a new user will be added maybe once in 3 months?

Sarah Berger MCSD
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-01-17 : 18:36:13
It depends on how quickly you need to be informed of the new user. I assume you can't wait 3 months, so you'd have to run it more frequently. It's up to you to decide the interval needed, with a minimum of 1 minute.

It's not a very involved query, so running it once a minute won't harm anything.

Go to Top of Page
   

- Advertisement -