Showing posts with label alert. Show all posts
Showing posts with label alert. Show all posts

Tuesday, March 27, 2012

creating alerts

I want to create an alert that for each time a sql view is deleted from the server alerts an operator and runs a sql query to recreate

I have the code for recreating the view and this can be manually invoked and need some help in automating this other than create a job to run at scheduled intervals as this is only needs executed when treh views have been deleted

**views are deleted by a rogue application processWouldn't it be better to find the process that is deleteing the iew(s) and stop it?

Creating Alert..?

Hi all,
How can I create a alert that can be activated on Sql responses:
If I for example would like to send a email alert to a sales rep if the
revenue is to low.
Example: select custno, revenue from MyTable where revenue<1000
SQL-mail response: "The level is to low! for custno"
/Kent J.
Kent,
1. Custom trigger --> xp_sendmail
2. Scheduled proc --> xp_sendmail
3. User Settable custom counter --> mail response
Also see:
http://www.sqldev.net/xp/xpsmtp.htm
HTH
Jerry
"Kent Johnson" <08.6044303@.telia.com> wrote in message
news:2VT5f.148747$dP1.506595@.newsc.telia.net...
> Hi all,
> How can I create a alert that can be activated on Sql responses:
> If I for example would like to send a email alert to a sales rep if the
> revenue is to low.
> Example: select custno, revenue from MyTable where revenue<1000
> SQL-mail response: "The level is to low! for custno"
> /Kent J.
>
|||Jerry,
I have installed XPSMTP80.ZIP
This is what I have tried:
declare @.rc int
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = N'kentjohnson@.test1.com',
@.TO = N'kent.johnson@.test2.se'
select RC = @.rc
This is the result:
Error: connecting to server smarthost
RC
1
Can I send the result from a stored procedure in the mail?
How can I do that?
/Kent J.
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:#pvT02b1FHA.3336@.TK2MSFTNGP12.phx.gbl...
> Kent,
> 1. Custom trigger --> xp_sendmail
> 2. Scheduled proc --> xp_sendmail
> 3. User Settable custom counter --> mail response
> Also see:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH
> Jerry
> "Kent Johnson" <08.6044303@.telia.com> wrote in message
> news:2VT5f.148747$dP1.506595@.newsc.telia.net...
>
sql

Creating Alert..?

Hi all,
How can I create a alert that can be activated on Sql responses:
If I for example would like to send a email alert to a sales rep if the
revenue is to low.
Example: select custno, revenue from MyTable where revenue<1000
SQL-mail response: "The level is to low! for custno"
/Kent J.Kent,
1. Custom trigger --> xp_sendmail
2. Scheduled proc --> xp_sendmail
3. User Settable custom counter --> mail response
Also see:
http://www.sqldev.net/xp/xpsmtp.htm
HTH
Jerry
"Kent Johnson" <08.6044303@.telia.com> wrote in message
news:2VT5f.148747$dP1.506595@.newsc.telia.net...
> Hi all,
> How can I create a alert that can be activated on Sql responses:
> If I for example would like to send a email alert to a sales rep if the
> revenue is to low.
> Example: select custno, revenue from MyTable where revenue<1000
> SQL-mail response: "The level is to low! for custno"
> /Kent J.
>|||Jerry,
I have installed XPSMTP80.ZIP
This is what I have tried:
declare @.rc int
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = N'kentjohnson@.test1.com',
@.TO = N'kent.johnson@.test2.se'
select RC = @.rc
This is the result:
Error: connecting to server smarthost
RC
--
1
Can I send the result from a stored procedure in the mail?
How can I do that?
/Kent J.
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:#pvT02b1FHA.3336@.TK2MSFTNGP12.phx.gbl...
> Kent,
> 1. Custom trigger --> xp_sendmail
> 2. Scheduled proc --> xp_sendmail
> 3. User Settable custom counter --> mail response
> Also see:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH
> Jerry
> "Kent Johnson" <08.6044303@.telia.com> wrote in message
> news:2VT5f.148747$dP1.506595@.newsc.telia.net...
>

Creating Alert..?

Hi all,
How can I create a alert that can be activated on Sql responses:
If I for example would like to send a email alert to a sales rep if the
revenue is to low.
Example: select custno, revenue from MyTable where revenue<1000
SQL-mail response: "The level is to low! for custno"
/Kent J.Kent,
1. Custom trigger --> xp_sendmail
2. Scheduled proc --> xp_sendmail
3. User Settable custom counter --> mail response
Also see:
http://www.sqldev.net/xp/xpsmtp.htm
HTH
Jerry
"Kent Johnson" <08.6044303@.telia.com> wrote in message
news:2VT5f.148747$dP1.506595@.newsc.telia.net...
> Hi all,
> How can I create a alert that can be activated on Sql responses:
> If I for example would like to send a email alert to a sales rep if the
> revenue is to low.
> Example: select custno, revenue from MyTable where revenue<1000
> SQL-mail response: "The level is to low! for custno"
> /Kent J.
>|||Jerry,
I have installed XPSMTP80.ZIP
This is what I have tried:
declare @.rc int
exec @.rc = master.dbo.xp_smtp_sendmail
@.FROM = N'kentjohnson@.test1.com',
@.TO = N'kent.johnson@.test2.se'
select RC = @.rc
This is the result:
Error: connecting to server smarthost
RC
--
1
Can I send the result from a stored procedure in the mail?
How can I do that?
/Kent J.
"Jerry Spivey" <jspivey@.vestas-awt.com> wrote in message
news:#pvT02b1FHA.3336@.TK2MSFTNGP12.phx.gbl...
> Kent,
> 1. Custom trigger --> xp_sendmail
> 2. Scheduled proc --> xp_sendmail
> 3. User Settable custom counter --> mail response
> Also see:
> http://www.sqldev.net/xp/xpsmtp.htm
> HTH
> Jerry
> "Kent Johnson" <08.6044303@.telia.com> wrote in message
> news:2VT5f.148747$dP1.506595@.newsc.telia.net...
> > Hi all,
> >
> > How can I create a alert that can be activated on Sql responses:
> > If I for example would like to send a email alert to a sales rep if the
> > revenue is to low.
> > Example: select custno, revenue from MyTable where revenue<1000
> > SQL-mail response: "The level is to low! for custno"
> >
> > /Kent J.
> >
> >
>

Thursday, March 8, 2012

creating a login with only backup and alert rights

What is the combination of rights to give a user access to only backup and a
lerts.Hi,
Backup the database, You can assign the database wise role
"db_backupoperator"
How to assign the backup operator role to test user
1. Use database name
2. Execute sp_addrolemember db_backupoperator ,test
To create Alerts , the user should be the member of SYSADMIN fixed server
role.
Thanks
Hari
MCDBA
"robert" <rsalazar@.cbbank.com> wrote in message
news:5190A3C1-E640-4F1C-BB84-8C242569ABFA@.microsoft.com...
> What is the combination of rights to give a user access to only backup and
alerts.