{"id":42,"date":"2015-04-06T15:18:00","date_gmt":"2015-04-06T14:18:00","guid":{"rendered":"https:\/\/debuggersspace.com\/index.php\/2015\/04\/06\/notification-services-in-sql-server-2005\/"},"modified":"2015-04-06T15:18:00","modified_gmt":"2015-04-06T14:18:00","slug":"notification-services-in-sql-server-2005","status":"publish","type":"post","link":"https:\/\/debuggersspace.com\/index.php\/2015\/04\/06\/notification-services-in-sql-server-2005\/","title":{"rendered":"Notification Services in SQL Server 2005"},"content":{"rendered":"<div class='booster-block booster-read-block'>\n                <div class=\"twp-read-time\">\n                \t<i class=\"booster-icon twp-clock\"><\/i> <span>Read Time:<\/span>4 Minute, 23 Second                <\/div>\n\n            <\/div><div dir=\"ltr\" style=\"text-align: left;\">\n<span style=\"background-color: #fefefe; font-size: 14px; line-height: 20px;\"><span style=\"font-family: Arial, Helvetica, sans-serif;\">SQL Server Notification Services is used for developing and deploying applications that generate and send notifications. Notifications are personalized messages sent to a device that subscribes to them. A subscription defines the preference of the subscriber for a specific type of event. For example, a subscriber can specify a preference to the notification application such as \u201cNotify me when new content is added to the Web site.\u201d The notification application in this example is the Web site. The subscriber could be the editor of the Web site or someone responsible for managing its content. The triggering event is the addition of new content. Thus, a notification will be sent to the subscriber when the triggering event occurs. The notification can be scheduled on a weekly, daily, or hourly basis. SQL Server Notification Services can be used to send a notification to a wide variety of devices, such as a subscriber\u2019s cell phone, personal digital assistant (PDA), Windows Messenger or e-mail account.<\/span><\/span><br \/>\n<span style=\"background-color: #fefefe; font-size: 14px; line-height: 20px;\"><span style=\"font-family: Arial, Helvetica, sans-serif;\"><br \/><\/span><\/span><\/p>\n<h2 style=\"background: rgb(254, 254, 254); border: 0px; font-size: 20px; line-height: 20px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">Terminologies in Notification services<\/span><\/h2>\n<ol style=\"background: rgb(254, 254, 254); border: 0px; font-size: 14px; line-height: 20px; list-style: none; margin: 0px 0px 15px; outline: 0px; padding: 0px 0px 0px 30px; vertical-align: baseline;\">\n<li style=\"background: transparent; border: 0px; list-style-type: decimal; margin: 0px 0px 5px; outline: 0px; padding: 0px; vertical-align: baseline;\"><span style=\"font-family: Arial, Helvetica, sans-serif;\"><strong style=\"background: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Subscriber<\/strong>&nbsp;is a person or application that subscribes to and receives notifications.<\/span><\/li>\n<li style=\"background: transparent; border: 0px; list-style-type: decimal; margin: 0px 0px 5px; outline: 0px; padding: 0px; vertical-align: baseline;\"><span style=\"font-family: Arial, Helvetica, sans-serif;\"><strong style=\"background: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Subscription<\/strong>&nbsp;is a request for specific information to be sent to an e-mail address or a device.<\/span><\/li>\n<li style=\"background: transparent; border: 0px; list-style-type: decimal; margin: 0px 0px 5px; outline: 0px; padding: 0px; vertical-align: baseline;\"><span style=\"font-family: Arial, Helvetica, sans-serif;\"><strong style=\"background: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Event<\/strong>&nbsp;is a piece of information that the subscriber may be interested in. The triggering event can be something like an increase or decrease in the price of a stock.<\/span><\/li>\n<li style=\"background: transparent; border: 0px; list-style-type: decimal; margin: 0px 0px 5px; outline: 0px; padding: 0px; vertical-align: baseline;\"><span style=\"font-family: Arial, Helvetica, sans-serif;\"><strong style=\"background: transparent; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;\">Notification<\/strong>&nbsp;is a message that contains information about the triggering event.<\/span><\/li>\n<\/ol>\n<div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">There are three major pieces to each notification service. Let\u2019s briefly define and explain each.<\/span><\/div>\n<h3 style=\"background-color: white; font-size: 19px; font-weight: normal;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">Events<\/span><\/h3>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">For a notification to be sent, there has to be some form of trigger. In SQL NS such a trigger is defined as an \u201cEvent\u201d. Events can be triggered by certain actions, or they can be in time intervals, it\u2019s up to the designer. All of the events for a notification service can be defined in the ADF for the service.<\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">An example of an event might be that bob wants to know when his flowers were delivered to his girlfriends house, so he subscribes to the notification service that the flower shop provides. The flower shop has defined an event in their service that generates a notification when the delivery person calls in to confirm delivery. Once the event is generated, the notification is created and delivered to bob via SMS messaging.<\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">An example of a timed event might be that a sale person from XYZ corp. needs an updated contact list each morning before he starts his day. An event is created in the notification services that creates a notification with his updated contact list and sends it to his mobile phone in the form of a smart messaging SMS message. With the press of a button, he accepts the message and his contact list is updated.<\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">Events are created in many ways, most commonly they are pulled from SQL databases, or system logs. When the event is defined in the ADF the method for retrieving the event data is also defined.<\/span><\/div>\n<h3 style=\"background-color: white; font-size: 19px; font-weight: normal;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">Notifications<\/span><\/h3>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">A notification is the actually data that is sent to a subscriber, it is basically a formatted form of the data that was retrieved when the event that goes with this notification was fired. The contents and format of the notifications that a service supports are defined in the ADF.<\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">Microsoft has provided an XSLT content formatter to make our lives easier in respect to notifications. It allows us to apply an XSLT transform to the raw notification data. This allows us to easily prepare a notification for display to a subscriber.<\/span><\/div>\n<h3 style=\"background-color: white; font-size: 19px; font-weight: normal;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">Subscriptions<\/span><\/h3>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">A subscriber is the actual real end user of the notification service, this is the guy who wants to be notified of his rising stock so he can buy his yacht. When SQL NS creates the notification service, it creates in SQL Server a database that is just for holding subscriber information. To add subscribers, the developer needs to create some sort of a subscription application, this may sound kind of like being left out cold, but that is not the case. The subscription application is left fully to the imagination of the designers of the service, but Microsoft has provided some tools that make it much easier to build. We don\u2019t have to know the full ER model of the subscription database because we can simply utilize the managed components Microsoft has provided for us to add subscribers.<\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">So, simply create an application for gathering the required information from a subscriber, and use the classes provided in the&nbsp;<code style=\"border: 0px; font-size: 11pt; font-stretch: normal; margin: 0px; padding: 0px;\">Microsoft.SqlServer.NotificationServices<\/code>&nbsp;namespace. (note these are .NET classes)<\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">Subscribers can choose the events they want to subscribe to, the format of the notifications they want, and even the media they want notifications sent to, and yes they can even choose more than one.<\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">Of course all these features don\u2019t program themselves, but they can easily be added to a service once you have a good handle on build ADFs. Notification services range from the very simple to the extremely complex. You can build one in a day or in a month. It all just depends on what is required for your situation.<\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\"><br \/><\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<span style=\"font-family: Arial, Helvetica, sans-serif;\">Ref:<\/span><\/div>\n<div style=\"background-color: white; font-size: 14px;\">\n<a href=\"http:\/\/www.sql-server-performance.com\/2007\/notification-services-2005\/\" target=\"_blank\" rel=\"noopener\"><span style=\"color: black; font-family: Arial, Helvetica, sans-serif;\">http:\/\/www.sql-server-performance.com\/2007\/notification-services-2005\/<\/span><\/a><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>SQL Server Notification Services is used for developing and deploying applications that generate and send notifications. Notifications are personalized messages sent to a device that subscribes to them. A subscription defines the preference of the subscriber for a specific type of event. For example, a subscriber can specify a preference to the notification application such [&hellip;]<\/p>\n","protected":false},"author":43,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[34],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-ibm"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Himanshu Namdeo","author_link":"https:\/\/debuggersspace.com\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"SQL Server Notification Services is used for developing and deploying applications that generate and send notifications. Notifications are personalized messages sent to a device that subscribes to them. A subscription defines the preference of the subscriber for a specific type of event. For example, a subscriber can specify a preference to the notification application such&hellip;","_links":{"self":[{"href":"https:\/\/debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts\/42"}],"collection":[{"href":"https:\/\/debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/debuggersspace.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/debuggersspace.com\/index.php\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/debuggersspace.com\/index.php\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":0,"href":"https:\/\/debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"wp:attachment":[{"href":"https:\/\/debuggersspace.com\/index.php\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/debuggersspace.com\/index.php\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/debuggersspace.com\/index.php\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}