Showing posts with label notification. Show all posts
Showing posts with label notification. Show all posts

Sunday, February 26, 2012

Event Type for Object:ALTERED, Object:Created , Object:Deleted Event Class

Hi

I am trying to create a EVENT NOTIFICATION for tracking changes to existing database objects. New Database objects, DEletion of any database objects.

For this I would like to know what is the EEVEN TYPE given in CREATE NOTIFICATION syntax for the three events...

CREATE EVENT NOTIFICATION Logging_Schema_Change_Notification

ON DATABASE

FOR Object:Altered_EVENT -- This is the piece that is failing ...what is the name ?

TO SERVICE 'LoggingSchemaService', 'current database'

GO

regards

Imtiaz

Try

FOR Object_Altered

FOR Object_Created

and

FOR Object_Deleted

Event Notification vs. Triggers

Hi,
Event Notifications can send a message to particular service while this can
be done exactly in a trigger. I mean the DDL/DML trigger can send required
message to a service for asynchronous processing. So what's the advantage of
using Event Notification?
Thanks,
Leila
See if this helps.
http://www.awprofessional.com/articl...&seqNum=5&rl=1
AMB
"Leila" wrote:

> Hi,
> Event Notifications can send a message to particular service while this can
> be done exactly in a trigger. I mean the DDL/DML trigger can send required
> message to a service for asynchronous processing. So what's the advantage of
> using Event Notification?
> Thanks,
> Leila
>
>

Event Notification vs. Triggers

Hi,
Event Notifications can send a message to particular service while this can
be done exactly in a trigger. I mean the DDL/DML trigger can send required
message to a service for asynchronous processing. So what's the advantage of
using Event Notification?
Thanks,
LeilaSee if this helps.
http://www.awprofessional.com/artic...4&seqNum=5&rl=1
AMB
"Leila" wrote:

> Hi,
> Event Notifications can send a message to particular service while this ca
n
> be done exactly in a trigger. I mean the DDL/DML trigger can send required
> message to a service for asynchronous processing. So what's the advantage
of
> using Event Notification?
> Thanks,
> Leila
>
>

Event Notification vs. Triggers

Hi,
Event Notifications can send a message to particular service while this can
be done exactly in a trigger. I mean the DDL/DML trigger can send required
message to a service for asynchronous processing. So what's the advantage of
using Event Notification?
Thanks,
LeilaSee if this helps.
http://www.awprofessional.com/articles/article.asp?p=327394&seqNum=5&rl=1
AMB
"Leila" wrote:
> Hi,
> Event Notifications can send a message to particular service while this can
> be done exactly in a trigger. I mean the DDL/DML trigger can send required
> message to a service for asynchronous processing. So what's the advantage of
> using Event Notification?
> Thanks,
> Leila
>
>

Event Notification Syntax Error

Hi

I have a simple question regarding event notification in sql 2005. I keep up getting a message indicating a syntax error when trying to execute the following script. I also tried with [ instead of '.

CREATE EVENT NOTIFICATION NotifyCT
ON DATABASE
FOR CREATE_TABLE
TO SERVICE 'NotifyService'

Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'NotifyService'.

I cannot find any error in my syntax. Please help

Thanks

You need to specify the broker instance for the service. Ex:

CREATE EVENT NOTIFICATION NotifyCT
ON DATABASE
FOR CREATE_TABLE
TO SERVICE 'NotifyService', '<broker_instance_guid>'

-- or

CREATE EVENT NOTIFICATION NotifyCT
ON DATABASE
FOR CREATE_TABLE
TO SERVICE 'NotifyService', 'current database'

See Books Online "CREATE EVENT NOTIFICATION" topic for more details.

Event Notification question

I am working on a c# app that utilizes Event Notification. So far I have bee
n
able to get it to work with pretty simplistic SQL statements but I have run
into a problem.
The query that I need the application to use relies on a view as part of an
inner join. When I add this SQL statement to the dependency the onChange
event fires continuously. Can I not use a view in a dependancy?
Here is the SQL that I am adding to the dependancy;
private string GetSQL()
{
return "SELECT dbo.Employees.FirstName, dbo.Employees.LastName,
dbo.Employees.Department, dbo.Employees.Email, " +
"dbo.Employees.Extension, dbo.EventLog.Type,
dbo.EventLog.Location, dbo.EventLog.Comment, dbo.EventLog.ReturnDateTime, "
+
"dbo.EventLog.Time FROM dbo.Employees INNER JOIN dbo.LastEvent
ON dbo.Employees.ID = dbo.LastEvent.EmployeeID " +
"INNER JOIN dbo.EventLog ON dbo.LastEvent.EmployeeID =
dbo.EventLog.EmployeeID AND dbo.LastEvent.LastEntry = dbo.EventLog.Time";
}
Everything in this SQL statement is a table except for LastEvent.
LastEvent is a pretty simple view that takes the EventLog tables EmployeeID
and Time and selects the most recent entry.
Could this circular refrencing back unto itself be part of my problem?I have narrowed my roblem down to the MAX aggregat function that I am using
in my view.
The view takes all fo a employees events and selects the most recent one
using a MAX(eventTime) aggregate.
Accoridng to the query generator I can not index the view as long as it
contains this MAX aggregate.
can anyone offer a suggested work around for this?|||The query restrictions are detailed here:
http://msdn2.microsoft.com/en-US/library/ms181122.aspx
The indexed view restrictions are detailed here:
http://msdn2.microsoft.com/en-US/library/ms191432(SQL.90).aspx
BTW, the feature is actually called Query Notifications. Event Notifications
is for delivering notifications when certain DDL events occur (like a table
is created or dropped).
--
This posting is provided "AS IS" with no warranties, and confers no rights.
HTH,
~ Remus Rusanu
SQL Service Broker
http://msdn2.microsoft.com/en-us/library/ms166043(en-US,SQL.90).aspx
"Codesmith" <Codesmith@.discussions.microsoft.com> wrote in message
news:B48F6877-D733-453B-9225-8338DED760E6@.microsoft.com...
>I am working on a c# app that utilizes Event Notification. So far I have
>been
> able to get it to work with pretty simplistic SQL statements but I have
> run
> into a problem.
> The query that I need the application to use relies on a view as part of
> an
> inner join. When I add this SQL statement to the dependency the onChange
> event fires continuously. Can I not use a view in a dependancy?
> Here is the SQL that I am adding to the dependancy;
> private string GetSQL()
> {
> return "SELECT dbo.Employees.FirstName, dbo.Employees.LastName,
> dbo.Employees.Department, dbo.Employees.Email, " +
> "dbo.Employees.Extension, dbo.EventLog.Type,
> dbo.EventLog.Location, dbo.EventLog.Comment, dbo.EventLog.ReturnDateTime,
> " +
> "dbo.EventLog.Time FROM dbo.Employees INNER JOIN dbo.LastEvent
> ON dbo.Employees.ID = dbo.LastEvent.EmployeeID " +
> "INNER JOIN dbo.EventLog ON dbo.LastEvent.EmployeeID =
> dbo.EventLog.EmployeeID AND dbo.LastEvent.LastEntry = dbo.EventLog.Time";
> }
> Everything in this SQL statement is a table except for LastEvent.
> LastEvent is a pretty simple view that takes the EventLog tables
> EmployeeID
> and Time and selects the most recent entry.
> Could this circular refrencing back unto itself be part of my problem?

Event notification on disabled queue: the conversation must end?

Hello,

I have configured an Event Notification for BROKER_QUEUE_DISABLED.

I created a Queue different from the one the Receive my normal messages and on this queue I define an activation.

The Activated SP takes the [EventNotification] message and execute a

RAISEERROR('Message',0,1) WITH LOG.

The error is properly logged in the SQL server event log but I gave a look the Initiator and target sys.conversation_endpoints catalog view and I have see the the conversations are in the status CONVERSING or SI ...

Do I have to call the END CONVERSATION after the commit or these statuses are caused by some mistakes on the message process workflow?

Thank you

Marina B.

The conversations used by the event notifications infrastructure should not be ended. They will be ended by initiator when the event notification object is dropped (DROP EVENT NOTIFICATION ...). You procedure should react to the EndDialog message by ending it's side. If you end the conversations prematurely from the procedure side you are in effect disabling the event notification (it will have to be dropped and created again).

This applies for all event notifications, it is not specific to BROKER_QUEUE_DISABLED.

Event Notification disapears from sys.event_notifications

Hello Remus,

I have implemented Event Notification sample you provided in my logic, but I am perplexed that even though my watched queue does go down, I do not get message in the Event_Collector queue all the time. The Event_Collector queue does stay enabled though. Any thoughts? I guess any suggestions on debugging the event notification portion would be helpful.

Lubomir
Upon further look at the sys.event_notifications view, I discovered that my event notification is not there any more - it disappears. So the first time the queue goes down, the notification is successful and the Event Notification is still in sys.event_notifications. Second attemp removes the Event Notification from sys.event_notifications.

Lubomir|||

Can you check if the event notification infrastructure isn't receving back an error or an end dialog message on the system dialog that delivers the notifications? Look into errorlog or in Event Viewer (Application), see if you find a record similar to one of these:

Event notification conversation on dialog handle '{4B086B77-C691-DA11-AD12-00030D303B72}' closed without an error.

or:

Closed event notification conversation endpoint with handle '{B1663957-C791-DA11-AD12-00030D303B72}', due to the following error: '<?xml version="1.0"?><Error xmlns="http://schemas.microsoft.com/SQL/ServiceBroker/Error"><Code>-8494</Code><Description>You do not have permission to access the service &apos;s&apos;.</Description></Error>'.

HTH,
~ Remus

|||Thank you Remus,

Yup it was the End Dialog message I had; Things work great now.

Lubomir

Event notification and Service Broker

Hello,

I read in one thread that Event notification can use Service Broker for delivery.
How Service broker can be used in Event Notification for delivery of notifications?

any further links or related article?

Thanks in advance
dipz

Hi -

"Out of the box" SQL Server Notification Services can send notifications via email or to a file (primarily used for testing and debugging). However, you can write your own delivery protocols to send messages via most any protocol you wish.

Can you provide a link to the thread that discusses using Service Broker with Notification Services? I'd like to read what the posters are saying would be a good integration; I don't know that I readily see it.

Here's a link to an MSDN article on Service Broker by Roger Wolter. It's a good read and a good place to get familar with Service Broker if you're not already familar with it.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sqlsvcbroker.asp
HTH...

--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)

|||

Thanks Joe.
Here, the link.
http://forums.microsoft.com/msdn/showpost.aspx?postid=99660&siteid=1

In the reply Roger has mentioned that "Event notifications use Service Broker for delivery but they are not part of Service Broker. "

Please let me know if there is relation between Event notification and Service Broker. Can we use Service broker in Event Notification?

Thanks and Regards
dipz

|||

Hi -

The two technologies share some of the same terminology, and from a very high level they share a bit of the same functionality, but they are designed to solve different business problems. Unfortunately the shared terminology frequently leads to confusion.

In the end, Service Broker does not use SQLNS for its event notification.

HTH...


--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)

Event notification and Service Broker

Hello,

I read in one thread that Event notification can use Service Broker for delivery.
How Service broker can be used in Event Notification for delivery of notifications?

any further links or related article?

Thanks in advance
dipz

Hi -

"Out of the box" SQL Server Notification Services can send notifications via email or to a file (primarily used for testing and debugging). However, you can write your own delivery protocols to send messages via most any protocol you wish.

Can you provide a link to the thread that discusses using Service Broker with Notification Services? I'd like to read what the posters are saying would be a good integration; I don't know that I readily see it.

Here's a link to an MSDN article on Service Broker by Roger Wolter. It's a good read and a good place to get familar with Service Broker if you're not already familar with it.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sqlsvcbroker.asp
HTH...

--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)

|||

Thanks Joe.
Here, the link.
http://forums.microsoft.com/msdn/showpost.aspx?postid=99660&siteid=1

In the reply Roger has mentioned that "Event notifications use Service Broker for delivery but they are not part of Service Broker. "

Please let me know if there is relation between Event notification and Service Broker. Can we use Service broker in Event Notification?

Thanks and Regards
dipz

|||

Hi -

The two technologies share some of the same terminology, and from a very high level they share a bit of the same functionality, but they are designed to solve different business problems. Unfortunately the shared terminology frequently leads to confusion.

In the end, Service Broker does not use SQLNS for its event notification.

HTH...


--
Joe Webb
SQL Server MVP
http://www.sqlns.com


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)

event notification

Does anyone know if there is any software available that notifies specified people when an error above a certian level occurs. Im thinking along the lines of email and text message.

Im running sql server 2k at sp3a level, and the software will have to be compatible with it so as to get the event notification to pass the information on.

If there isn't any software, would anyone know of any scripts that will do this?I'd use the SQL Mail (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_1_server_8xf0.asp) that is included with SQL Server (at least until somebody dreams up a need that it can't fulfill).

-PatP|||ok, cheers. Any ideas on a text message notification method?|||As a great man is fond of saying: Huh?

Email works well enough for most things, and most SMS providers have a pop to SMS interface. Does that answer the question that you were asking?

-PatP|||i'll have to do a bit of research into that one, but generally yes it does answer my question. Just to give an outline of what im trying to do is when an error on the server occurs, it sends an email to a specified preson (or persons), along with an SMS message being sent to a specific person, so that they can get to the office and sort the problem out if out of hours.

Friday, February 24, 2012

Event Log

I'm trying to create an alert that will tell me when a database is deleted o
r
added.
I can't seem to find a notification i the event log when either happens.
Also I would like create an alert for my maintenance jobs when they
complete. But I see no trace of them in the event log.
Thank YouAFAIK there is no alert for dropping or adding a db within SQL Server. You
can use a third party product from www.lumigent.com called Integra that may
do what you want. As for the MP's, why would you want to know when they
complete. The whole idea of creating them is so they can run attended. In
any case you can always add a RAISERROR() to a job step that will force an
error that will be picked up by an alert.
Andrew J. Kelly SQL MVP
"robert_at_cbb" <robertatcbb@.discussions.microsoft.com> wrote in message
news:B420F0DD-4186-44CE-B031-CE5C0F9C4026@.microsoft.com...
> I'm trying to create an alert that will tell me when a database is deleted
> or
> added.
> I can't seem to find a notification i the event log when either happens.
> Also I would like create an alert for my maintenance jobs when they
> complete. But I see no trace of them in the event log.
> Thank You|||If you use SQL Server Agent to schedule your jobs, there is an option to
have the event logged to the Windows event log. This under the
notifications tab when double clicking on the job via the EM console.
-Ben
robert_at_cbb wrote:

> I'm trying to create an alert that will tell me when a database is deleted
or
> added.
> I can't seem to find a notification i the event log when either happens.
> Also I would like create an alert for my maintenance jobs when they
> complete. But I see no trace of them in the event log.
> Thank You|||Thanks!
Too bad notification for dropping severs is not available. I have many
servers, and I want to know that my maintenance jobs finish.
"Ben" wrote:

> If you use SQL Server Agent to schedule your jobs, there is an option to
> have the event logged to the Windows event log. This under the
> notifications tab when double clicking on the job via the EM console.
> -Ben
>
>
> robert_at_cbb wrote:
>
>

Event Log

I'm trying to create an alert that will tell me when a database is deleted or
added.
I can't seem to find a notification i the event log when either happens.
Also I would like create an alert for my maintenance jobs when they
complete. But I see no trace of them in the event log.
Thank You
AFAIK there is no alert for dropping or adding a db within SQL Server. You
can use a third party product from www.lumigent.com called Integra that may
do what you want. As for the MP's, why would you want to know when they
complete. The whole idea of creating them is so they can run attended. In
any case you can always add a RAISERROR() to a job step that will force an
error that will be picked up by an alert.
Andrew J. Kelly SQL MVP
"robert_at_cbb" <robertatcbb@.discussions.microsoft.com> wrote in message
news:B420F0DD-4186-44CE-B031-CE5C0F9C4026@.microsoft.com...
> I'm trying to create an alert that will tell me when a database is deleted
> or
> added.
> I can't seem to find a notification i the event log when either happens.
> Also I would like create an alert for my maintenance jobs when they
> complete. But I see no trace of them in the event log.
> Thank You
|||If you use SQL Server Agent to schedule your jobs, there is an option to
have the event logged to the Windows event log. This under the
notifications tab when double clicking on the job via the EM console.
-Ben
robert_at_cbb wrote:

> I'm trying to create an alert that will tell me when a database is deleted or
> added.
> I can't seem to find a notification i the event log when either happens.
> Also I would like create an alert for my maintenance jobs when they
> complete. But I see no trace of them in the event log.
> Thank You
|||Thanks!
Too bad notification for dropping severs is not available. I have many
servers, and I want to know that my maintenance jobs finish.
"Ben" wrote:

> If you use SQL Server Agent to schedule your jobs, there is an option to
> have the event logged to the Windows event log. This under the
> notifications tab when double clicking on the job via the EM console.
> -Ben
>
>
> robert_at_cbb wrote:
>

Event Log

I'm trying to create an alert that will tell me when a database is deleted or
added.
I can't seem to find a notification i the event log when either happens.
Also I would like create an alert for my maintenance jobs when they
complete. But I see no trace of them in the event log.
Thank YouAFAIK there is no alert for dropping or adding a db within SQL Server. You
can use a third party product from www.lumigent.com called Integra that may
do what you want. As for the MP's, why would you want to know when they
complete. The whole idea of creating them is so they can run attended. In
any case you can always add a RAISERROR() to a job step that will force an
error that will be picked up by an alert.
--
Andrew J. Kelly SQL MVP
"robert_at_cbb" <robertatcbb@.discussions.microsoft.com> wrote in message
news:B420F0DD-4186-44CE-B031-CE5C0F9C4026@.microsoft.com...
> I'm trying to create an alert that will tell me when a database is deleted
> or
> added.
> I can't seem to find a notification i the event log when either happens.
> Also I would like create an alert for my maintenance jobs when they
> complete. But I see no trace of them in the event log.
> Thank You|||If you use SQL Server Agent to schedule your jobs, there is an option to
have the event logged to the Windows event log. This under the
notifications tab when double clicking on the job via the EM console.
-Ben
robert_at_cbb wrote:
> I'm trying to create an alert that will tell me when a database is deleted or
> added.
> I can't seem to find a notification i the event log when either happens.
> Also I would like create an alert for my maintenance jobs when they
> complete. But I see no trace of them in the event log.
> Thank You|||Thanks!
Too bad notification for dropping severs is not available. I have many
servers, and I want to know that my maintenance jobs finish.
"Ben" wrote:
> If you use SQL Server Agent to schedule your jobs, there is an option to
> have the event logged to the Windows event log. This under the
> notifications tab when double clicking on the job via the EM console.
> -Ben
>
>
> robert_at_cbb wrote:
> > I'm trying to create an alert that will tell me when a database is deleted or
> > added.
> >
> > I can't seem to find a notification i the event log when either happens.
> >
> > Also I would like create an alert for my maintenance jobs when they
> > complete. But I see no trace of them in the event log.
> >
> > Thank You
>