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)
 How to run function when someone connect database

Author  Topic 

roy_kty
Starting Member

29 Posts

Posted - 2006-10-27 : 05:15:44
Dear all,

May I ask how to run a function or procedure when someone try to connect to your database.
Is there any event or trigger??
Thx for your answer!!

Roy

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2006-10-27 : 07:15:17
Interesting question Roy I always thought you had to do this from the front-end application but maybe a INSTEAD OF trigger could be used to do this in some way, shape or form.
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2006-10-27 : 08:43:02
The only way I can think to do it is to set up a server-side trace to capture login events. Have the trace log to a table and author a trigger on insert.

Jay White
Go to Top of Page

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2006-10-27 : 09:07:55
that is very clever thinking for a friday afternoon Jay.
Go to Top of Page

roy_kty
Starting Member

29 Posts

Posted - 2006-10-27 : 22:44:26
I only try to find the method
I can do it on application.
Thx for your answer!!
Go to Top of Page

TonyTheDBA
Posting Yak Master

121 Posts

Posted - 2006-10-30 : 07:37:37
quote:
The only way I can think to do it is to set up a server-side trace to capture login events. Have the trace log to a table and author a trigger on insert.
Now that is clever thinking, I've been thinking about something like this as we are going to move from a Per CPU licence mode to a CAL based one and charge out departments based on the number of clients they have connecting . . . In order to do that we need to get some idea of how many users are connecting . . .I've got something to work on now :)

Thanks

--
Regards
Tony The DBA
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-10-30 : 07:43:51
quote:
Originally posted by roy_kty

I only try to find the method
I can do it on application.
This must be the obvious and best answer of all times...


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -