Hi,
I need to have something like a "login event" so that whenever a user logs
into SQL server, I can execute certain commands or SPs. So far, I've been
using this event in my client app that when a user clicks on the login
button, I do those jobs. But I want SQL server to handle and perform these
activities automatically and recognize each login.
Any help would be greatly appreciated.
AminTHere is no such event inside SQL Server.
AND you can't put triggers on SYSprocesses (which would be the next thing to
try).
You can write a proc that watches sysprocesses for new connections, or
you can catch logins with profiler and write a program that watches the
profiler output or
you can catch logins in the SQL error log (turn this on via SQL Enterprise
Manager on the Server->security tab and write a program that watches the SQL
log but
NONE of these will allow you to run proces etc on the newly connected
thread...
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Amin Sobati" <amins@.morva.net> wrote in message
news:%23qLxNBACEHA.3784@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I need to have something like a "login event" so that whenever a user logs
> into SQL server, I can execute certain commands or SPs. So far, I've been
> using this event in my client app that when a user clicks on the login
> button, I do those jobs. But I want SQL server to handle and perform these
> activities automatically and recognize each login.
> Any help would be greatly appreciated.
> Amin
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment