Raising Events from SQL Server - Event Handling from .NET

Raising Events from SQL Server - Event Handling from .NET

Post by Phil Jone » Thu, 15 May 2003 01:00:24



Is there a way to raise an event from within SQL Server (possibly from
within a Trigger) that can be attached to from within a .NET assembly?

I can see how Triggers operate as events within the context of the SQL
Server, but is there a way to implement DB events on a wider scope?

Thanks anyone....

--
Phil
New Zealand (Aotearoa)

 
 
 

Raising Events from SQL Server - Event Handling from .NET

Post by Tibor Karasz » Thu, 15 May 2003 08:09:35


The only thing I can think of it RAISERROR...

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...


Quote:> Is there a way to raise an event from within SQL Server (possibly from
> within a Trigger) that can be attached to from within a .NET assembly?

> I can see how Triggers operate as events within the context of the SQL
> Server, but is there a way to implement DB events on a wider scope?

> Thanks anyone....

> --
> Phil
> New Zealand (Aotearoa)


 
 
 

Raising Events from SQL Server - Event Handling from .NET

Post by Phil Jone » Fri, 16 May 2003 01:58:45


Thanks Tibor.  That's an interesting thought that I'll follow up.  Another
idea is perhaps "Sql Notifications".
Not sure on any of this at present.

Cheers

--
Phil
New Zealand (Aotearoa)

 
 
 

Raising Events from SQL Server - Event Handling from .NET

Post by Bill Cheng [MSFT » Fri, 16 May 2003 07:54:01


Hi Phil,

That depends your detailed scenario. I am not sure what "can be attached to
from within a .NET assembly" mean.

SQL Server notification service provides a flexibile infrastructure. You
can define your own notification mechanism besides standard File, SMTP
mechanism that your application can consume.

This posting is provided "AS IS" with no warranties, and confers no rights.

Regards,

Bill Cheng
Microsoft Support Engineer
--------------------



| Subject: Re: Raising Events from SQL Server - Event Handling from .NET
| Date: Thu, 15 May 2003 11:58:45 +1200
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

| Newsgroups: microsoft.public.sqlserver.programming
| NNTP-Posting-Host: 203-79-98-72.tnt13.paradise.net.nz 203.79.98.72
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.programming:358270
| X-Tomcat-NG: microsoft.public.sqlserver.programming
|
| Thanks Tibor.  That's an interesting thought that I'll follow up.  Another
| idea is perhaps "Sql Notifications".
| Not sure on any of this at present.
|
| Cheers
|
|
| --
| Phil
| New Zealand (Aotearoa)
|
|
|
|

 
 
 

Raising Events from SQL Server - Event Handling from .NET

Post by Greg Linwoo » Fri, 16 May 2003 10:12:06


Hi Phil.

One other option might be to use message queueing.. The trigger could access
an MQ COM interface directly from t-sql via the sp_OACreate series of stored
procs, or you might do something a little more light-weight via xp_..

Regards,
Greg Linwood
SQL Server MVP


Quote:> Is there a way to raise an event from within SQL Server (possibly from
> within a Trigger) that can be attached to from within a .NET assembly?

> I can see how Triggers operate as events within the context of the SQL
> Server, but is there a way to implement DB events on a wider scope?

> Thanks anyone....

> --
> Phil
> New Zealand (Aotearoa)

 
 
 

1. SQL Server Raising Events To Visual Basic Clients

Hello All,

I have a simple problem and would like to know the best, simplest
solution.

I have numerous VB 6.0 client applications accessing a SQL Server
database.

The database contains typical Accounts Recievables data, such as
Invoices, Credits, Payments, etc.

Every time an invoice is created and saved (by any of the various
users of the system), I would like all of the client applications (and
hence, users) to be NOTIFIED somehow of this new invoice.  Also, I
would like the server to spit back to each client the "Total Sales For
Today."

BOTTOM LINE: I want the total sales to be spit back to each client in
[approximately] REAL TIME as the sales are being made!

What's the best way to do this?

One very simple way I can think of is stick a timer somewhere on my
main VB form and have it query the database, say, every 10 seconds to
check for updated data.  However, this does not strike me as very
elegant or efficient, and seems like it would be very resource
intensive.

Can SQL Server fire some sort of an event that is broadcasted (and,
can be intercepted) by all client connections?

Eagerly awaited your response.

2. ODBC Poblem with ASP

3. Three event logged in the event view About SQLAgent whenever clear the event logs or failover

4. Full Recovery Mode

5. Which SQL-DMO Objects Raise Events?

6. Parallel Recovery

7. SQL Server DMO Backup Object Events Not Firing Correctly with Visual Basic .NET

8. Help on Using INGRES sql.....

9. Handling database events (or trigger) outside server

10. Events Handling using Oracle Web Application Server

11. DTS-Object doesn't raise OnProgress-event

12. Raising table action events

13. How to raise an event from a trigger?