Sending messages to application using sockets

Sending messages to application using sockets

Post by Kozik Hans-Jürge » Tue, 23 Nov 1999 04:00:00



My Sytem: Windows NT 4.0 Server (SP5), SQL - Server 7.0 (SP1)

I want to send a message to my application if my data changes in my tables
using socket-communication. My idea is to use triggers on my tables who
watch inserts, deletes or updates.

Is it possible for the SQL Server to send a message using sockets when the
trigger is executed?

 
 
 

Sending messages to application using sockets

Post by Neil Pik » Tue, 23 Nov 1999 04:00:00


Kozik,

Quote:> Subject: Sending messages to application using sockets

Q.     How can I run an external (non-SQL) program/dll etc. from within a TSQL
SQL Server script?  What sort of function can I perform?
(v1.1  1999.11.22)

A. As far as functionality goes, you can do anything you like - read/write
files, send network messages, call OLE/COM functions, kick off other programs,
run ftp's etc. etc.

There are a choice of ways of invoking these things :-

1.     Write your own extended stored procedure - which is essentially a DLL
with some SQL call constructs in.  See Q190987 for more details.  You can't
code XP's in VB, so you will need C (or Delphi) programming knowledge.
   For SQL 6.5 download the PTK from
http://support.microsoft.com/download/support/mslfiles/PTK_I386.EXE
   For SQL 7 look on the CD under \devtools

2.     Use the SQL OLE Automation calls - sp_OAxyz  See Q152801 and the
books-online.

3.     Run an external .EXE via the supplied xp_cmdshell extended stored
procedure.  See the books online for details.

 Neil Pike MVP/MCSE.  Protech Computing Ltd
 (Please reply only to newsgroups)
 SQL FAQ (365 entries) see

 or www.ntfaq.com/sql.html (+ ntfaq download)
 or http://www.swynk.com/faq/sql/sqlserverfaq.asp
 or http://www.sql-server.co.uk