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
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Jonathan Kehayias
»
Getting Started with SQL Server Event...
29 posts, Page 1 of 3
1
2
3
»
»»
Getting Started with SQL Server Event Notifications
Rate Topic
Display Mode
Topic Options
Author
Message
Jonathan Kehayias
Jonathan Kehayias
Posted Tuesday, December 22, 2009 12:08 AM
SSCommitted
Group: General Forum Members
Last Login: Monday, June 03, 2013 7:03 PM
Points: 1,696,
Visits: 1,746
Comments posted to this topic are about the item
Getting Started with SQL Server Event Notifications
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog
|
Twitter
|
MVP Profile
Training
|
Consulting
|
Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
Post #837753
Scott Abrants
Scott Abrants
Posted Tuesday, December 22, 2009 6:02 AM
SSC Rookie
Group: General Forum Members
Last Login: Friday, June 14, 2013 7:45 AM
Points: 43,
Visits: 308
Very nice work. Well written and very useful.
Thank you
Post #837860
SQLRNNR
SQLRNNR
Posted Tuesday, December 22, 2009 11:32 AM
SSCoach
Group: General Forum Members
Last Login: Today @ 9:30 AM
Points: 18,857,
Visits: 12,441
Nice Article
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #838112
ggoble
ggoble
Posted Tuesday, December 22, 2009 1:13 PM
Old Hand
Group: General Forum Members
Last Login: Monday, June 10, 2013 2:29 PM
Points: 370,
Visits: 854
So if I want to implement this on another databases, I would have to create the stored procedure in each database and then sign the procedure with the cert correct?
Also if I am currently using db mail in other stored procedures will I have to sign the certificate to all of those as well for them to continue to work?
Post #838187
Stan_Segers
Stan_Segers
Posted Tuesday, December 22, 2009 2:25 PM
Forum Newbie
Group: General Forum Members
Last Login: 2 days ago @ 2:38 PM
Points: 8,
Visits: 298
You only need to set up the Event Notification for the database (or server). The stored procedure is only needed in the database where the queue resides. You could send the events to another database or even another server. Also, you are not required to use signed procedures.
I did a blog-post some time ago to catch deadlocks with event notification. This shows you how to handle server level events.
Deadlock Alerts Trough Event Notification
and doesn't use signed procedures.
Post #838265
Jonathan Kehayias
Jonathan Kehayias
Posted Tuesday, December 22, 2009 2:55 PM
SSCommitted
Group: General Forum Members
Last Login: Monday, June 03, 2013 7:03 PM
Points: 1,696,
Visits: 1,746
greggoble2 (12/22/2009)
So if I want to implement this on another databases, I would have to create the stored procedure in each database and then sign the procedure with the cert correct?
Also if I am currently using db mail in other stored procedures will I have to sign the certificate to all of those as well for them to continue to work?
Trace events are server scoped, so you don't need multiple Notifications per database for this. If you used DDL Events at the database level, it would have to be created per database, and to send email through queue activation from that database with DatabaseMail would require signing it with a certificate as the most secure method. I covered the purpose behind using certificate signing to access DatabaseMail from a non-msdb database on my article last week
Using a Certificate Signed Stored Procedure to Execute sp_send_dbmail
.
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog
|
Twitter
|
MVP Profile
Training
|
Consulting
|
Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
Post #838281
Jonathan Kehayias
Jonathan Kehayias
Posted Tuesday, December 22, 2009 3:00 PM
SSCommitted
Group: General Forum Members
Last Login: Monday, June 03, 2013 7:03 PM
Points: 1,696,
Visits: 1,746
Stan_Segers (12/22/2009)
You only need to set up the Event Notification for the database (or server). The stored procedure is only needed in the database where the queue resides. You could send the events to another database or even another server. Also, you are not required to use signed procedures.
I did a blog-post some time ago to catch deadlocks with event notification. This shows you how to handle server level events.
Deadlock Alerts Trough Event Notification
and doesn't use signed procedures.
You can create the server level items in msdb to get around the signed procedure but since that isn't a recommended practice, I don't offer ideas like that in online articles. It is one way to go about it though. I keep these kinds of things in DBA_DATA database on my servers personally, but everyone has their own methods.
This is the first in a series I have written on using Event Notifications and there is an article on capturing Deadlock Graphs pending publication, though I take things a bit further in my article than you did on your blog post by parsing the XML and retrieving additional information regarding the executing statements like their query plans which are important in deadlock analysis.
Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog
|
Twitter
|
MVP Profile
Training
|
Consulting
|
Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
Post #838284
ggoble
ggoble
Posted Tuesday, December 22, 2009 3:40 PM
Old Hand
Group: General Forum Members
Last Login: Monday, June 10, 2013 2:29 PM
Points: 370,
Visits: 854
Thanks for the info! Great stuff!
Post #838303
Mark_Pratt
Mark_Pratt
Posted Tuesday, December 22, 2009 4:45 PM
Mr or Mrs. 500
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 2:50 PM
Points: 573,
Visits: 494
Excellent article. Looking forward to more like it !!!!!
Post #838322
louis.young
louis.young
Posted Tuesday, December 22, 2009 10:05 PM
Forum Newbie
Group: General Forum Members
Last Login: Sunday, January 03, 2010 9:36 PM
Points: 1,
Visits: 4
I've copied the T-SQL from this article exactly and executed it. All works fine, but when I view the queue:
SELECT *
FROM EventNotificationQueue
there are no records. What am I doing wrong?
Post #838360
« Prev Topic
|
Next Topic »
29 posts, Page 1 of 3
1
2
3
»
»»
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.