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.
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. |
 |
|
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 |
 |
|
Jim77
Constraint Violating Yak Guru
440 Posts |
Posted - 2006-10-27 : 09:07:55
|
that is very clever thinking for a friday afternoon Jay. |
 |
|
roy_kty
Starting Member
29 Posts |
Posted - 2006-10-27 : 22:44:26
|
I only try to find the methodI can do it on application.Thx for your answer!! |
 |
|
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-- RegardsTony The DBA |
 |
|
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 methodI can do it on application.
This must be the obvious and best answer of all times...Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|