Can't work out how to do the following:
We have a database in which a user keeps being deleted at
random intervals.
How do i configure SQL to email me when this user is
deleted?
I tried to create a delete trigger on the sysusers table
which raises a user defined error which is written to the
windows event log. SQL Agent then reads the event log and
fires off an email to me. HoweverI don't think you can
create triggers on system tables (I get a permission
denied message when I try to create this trigger, even
though I'm a system admin).
There must be an easy solution to this?You could try to setup a job that looks to see if that user exists in
syslogins/sysusers, then fire off an email if it doesn't. Set the job to
run ever 15 minutes or so.
Rather than approaching the problem this way, I would run SQL Profiler and
try to find out exactly what's happening when this user is deleted and why
it's happening.
"Stu" <stu_hearn@.yahoo.co.uk> wrote in message
news:0bd001c352c7$80d4dff0$a501280a@.phx.gbl...
> Can't work out how to do the following:
> We have a database in which a user keeps being deleted at
> random intervals.
> How do i configure SQL to email me when this user is
> deleted?
> I tried to create a delete trigger on the sysusers table
> which raises a user defined error which is written to the
> windows event log. SQL Agent then reads the event log and
> fires off an email to me. HoweverI don't think you can
> create triggers on system tables (I get a permission
> denied message when I try to create this trigger, even
> though I'm a system admin).
> There must be an easy solution to this?
>
>|||I did think about using profiler, however its usually a
period of weeks between deletions of this user, so this
would mean leaving profiler running continuosly and i
would have to monitor profiler each day to look for this
event. I'd prefer to be notified as the deletion occurs.
>--Original Message--
>You could try to setup a job that looks to see if that
user exists in
>syslogins/sysusers, then fire off an email if it
doesn't. Set the job to
>run ever 15 minutes or so.
>Rather than approaching the problem this way, I would run
SQL Profiler and
>try to find out exactly what's happening when this user
is deleted and why
>it's happening.
>
>"Stu" <stu_hearn@.yahoo.co.uk> wrote in message
>news:0bd001c352c7$80d4dff0$a501280a@.phx.gbl...
>> Can't work out how to do the following:
>> We have a database in which a user keeps being deleted
at
>> random intervals.
>> How do i configure SQL to email me when this user is
>> deleted?
>> I tried to create a delete trigger on the sysusers table
>> which raises a user defined error which is written to
the
>> windows event log. SQL Agent then reads the event log
and
>> fires off an email to me. HoweverI don't think you can
>> create triggers on system tables (I get a permission
>> denied message when I try to create this trigger, even
>> though I'm a system admin).
>> There must be an easy solution to this?
>>
>
>.
>|||Yup, that certainly presents a problem to using profiler. You may be able to
still use it looking for only specific events--that wouldn't put too much
strain on the server, however you probably wouldn't get enough info to do
any real troubleshooting.
You might want to add another step to that periodic job to take a snapshot
of sysprocesses -- at least you might be able to see who's logged in when
this seems to occur. There may be some consistency there.
Anyways, tough situation. Good luck!
"Stu" <stu_hearn@.yahoo.co.uk> wrote in message
news:1cbb01c352ce$de3aec50$a001280a@.phx.gbl...
> I did think about using profiler, however its usually a
> period of weeks between deletions of this user, so this
> would mean leaving profiler running continuosly and i
> would have to monitor profiler each day to look for this
> event. I'd prefer to be notified as the deletion occurs.
>
> >--Original Message--
> >You could try to setup a job that looks to see if that
> user exists in
> >syslogins/sysusers, then fire off an email if it
> doesn't. Set the job to
> >run ever 15 minutes or so.
> >
> >Rather than approaching the problem this way, I would run
> SQL Profiler and
> >try to find out exactly what's happening when this user
> is deleted and why
> >it's happening.
> >
> >
> >"Stu" <stu_hearn@.yahoo.co.uk> wrote in message
> >news:0bd001c352c7$80d4dff0$a501280a@.phx.gbl...
> >> Can't work out how to do the following:
> >>
> >> We have a database in which a user keeps being deleted
> at
> >> random intervals.
> >>
> >> How do i configure SQL to email me when this user is
> >> deleted?
> >>
> >> I tried to create a delete trigger on the sysusers table
> >> which raises a user defined error which is written to
> the
> >> windows event log. SQL Agent then reads the event log
> and
> >> fires off an email to me. HoweverI don't think you can
> >> create triggers on system tables (I get a permission
> >> denied message when I try to create this trigger, even
> >> though I'm a system admin).
> >> There must be an easy solution to this?
> >>
> >>
> >>
> >
> >
> >.
> >
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment