Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server Newbies
»
Alert Database creation
Alert Database creation
Rate Topic
Display Mode
Topic Options
Author
Message
Eswin
Eswin
Posted Sunday, June 28, 2009 11:08 PM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 4:19 AM
Points: 1,593,
Visits: 1,025
HI Expertz
Can anyone please tell me how to create an alert (send mail) when a new database is created and also for Backup and Restore operations in your server.
Tanx
Post #743354
hi_abhay78
hi_abhay78
Posted Sunday, June 28, 2009 11:51 PM
SSC Veteran
Group: General Forum Members
Last Login: Thursday, July 26, 2012 10:06 AM
Points: 267,
Visits: 385
You can create an SP using xp_sendmail .Finally create a job that executes daily before you come to office and send you the mail .In xp_sendmail you can use the query :
select * from sys.databases where datediff(day,create_date ,getdate()) <=1
For backups you can configure alerts or just add the same step mentioned above with message "backup on server XXXX failed" as a step in case the backup fails in the job .
Regards
Abhay Chaudhary
Sr.DBA (MCITP/MCTS :SQL Server 2005/2008 ,OCP 9i)
Post #743367
Eswin
Eswin
Posted Monday, June 29, 2009 12:03 AM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 4:19 AM
Points: 1,593,
Visits: 1,025
Is this possible in express edition.
Tanx
Post #743373
hi_abhay78
hi_abhay78
Posted Monday, June 29, 2009 12:12 AM
SSC Veteran
Group: General Forum Members
Last Login: Thursday, July 26, 2012 10:06 AM
Points: 267,
Visits: 385
I have never tried creating the database mail profiles and accounts through Express .But for jobs you need SQL Agent .
Normal Express does nto have express agent with it .
you need to install advanced tools for SQL Express .After that it should work .I am confident that database mail is suported in Express as well ..
Regards
Abhay Chaudhary
Sr.DBA (MCITP/MCTS :SQL Server 2005/2008 ,OCP 9i)
Post #743375
Lynn Pettis
Lynn Pettis
Posted Monday, July 06, 2009 8:30 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 11:18 AM
Points: 21,632,
Visits: 27,490
Database Mail is not supported in the Express Edition, nor is SQL Server Agent.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #748244
hi_abhay78
hi_abhay78
Posted Monday, July 06, 2009 9:31 PM
SSC Veteran
Group: General Forum Members
Last Login: Thursday, July 26, 2012 10:06 AM
Points: 267,
Visits: 385
As per this MSDN , yes its not supported .
http://msdn.microsoft.com/en-us/library/ms165636(SQL.90).aspx
But there is a tweak :)
Copy DatabaseMail90.exe, DatabaseMailEngine.dll and DatabaseMailProtocols.dll into the MSSQL\Binn directory and execute below mentioned system SPs (in MSDB context)
dbo.sysmail_start_sp
dbo.sysmail_stop_sp
You are done .Actually these 3 files you need to copy from ENT edition or STD edition.
Regards
Abhay Chaudhary
Sr.DBA (MCITP/MCTS :SQL Server 2005/2008 ,OCP 9i)
Post #748270
Lynn Pettis
Lynn Pettis
Posted Monday, July 06, 2009 10:09 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 11:18 AM
Points: 21,632,
Visits: 27,490
hi_abhay78 (7/6/2009)
As per this MSDN , yes its not supported .
http://msdn.microsoft.com/en-us/library/ms165636(SQL.90).aspx
But there is a tweak :)
Copy DatabaseMail90.exe, DatabaseMailEngine.dll and DatabaseMailProtocols.dll into the MSSQL\Binn directory and execute below mentioned system SPs (in MSDB context)
dbo.sysmail_start_sp
dbo.sysmail_stop_sp
You are done .Actually these 3 files you need to copy from ENT edition or STD edition.
Regards
And probably not legal either unless those files are part of a redistibutable package. Which means if you have any problems you won't get any support from Microsoft.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #748291
John Mitchell-245523
John Mitchell-245523
Posted Thursday, July 09, 2009 4:39 AM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Yesterday @ 8:44 AM
Points: 4,434,
Visits: 7,218
Have you looked at DDL triggers? As far as I know, you can create a trigger that will fire when a DDL event (such as creation of a database) occurs, and have that trigger send the e-mail. That way, you get your notification immediately and don't have to wait until the next morning.
John
Post #750058
Kevi322000
Kevi322000
Posted Tuesday, February 14, 2012 7:37 AM
SSC-Addicted
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 12:56 PM
Points: 428,
Visits: 136
only Thing about using triggers, is the fact you can take a hit on the performance. It just depends on the Transaction you are monitoring, something like creating new databases should not happen to often so it may not be a major issue. You might consider using SCOM, SQL DM, or any of the SQL monitoring tools.
Post #1251909
Mohammed Imran Ali
Mohammed Imran Ali
Posted Wednesday, May 08, 2013 10:07 PM
Valued Member
Group: General Forum Members
Last Login: Sunday, May 19, 2013 6:33 AM
Points: 65,
Visits: 202
John Mitchell-245523 (7/9/2009)
Have you looked at DDL triggers? As far as I know, you can create a trigger that will fire when a DDL event (such as creation of a database) occurs, and have that trigger send the e-mail. That way, you get your notification immediately and don't have to wait until the next morning.
John
This could be a very late reply.
Sending e-mails from DDL Triggers (or for that reason any trigger) could give some misleading error messages like incorrect "mail profile names" or "Databasemail XP warnings" when creating a new database/table.
Post #1450876
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.