Click here to Skip to main content
15,913,090 members
Home / Discussions / Database
   

Database

 
Generalretrieving datetime from recordset Pin
elephantstar31-Jan-05 8:49
elephantstar31-Jan-05 8:49 
GeneralRe: retrieving datetime from recordset Pin
WoutL31-Jan-05 10:59
WoutL31-Jan-05 10:59 
GeneralRe: retrieving datetime from recordset Pin
elephantstar31-Jan-05 11:14
elephantstar31-Jan-05 11:14 
GeneralTrigger Dates Pin
Tom Wright31-Jan-05 7:41
Tom Wright31-Jan-05 7:41 
GeneralRe: Trigger Dates Pin
Colin Angus Mackay31-Jan-05 9:38
Colin Angus Mackay31-Jan-05 9:38 
GeneralRe: Trigger Dates Pin
cmk31-Jan-05 9:53
cmk31-Jan-05 9:53 
GeneralRe: Trigger Dates Pin
Tom Wright31-Jan-05 11:53
Tom Wright31-Jan-05 11:53 
GeneralRe: Trigger Dates Pin
cmk31-Jan-05 14:23
cmk31-Jan-05 14:23 
Yes, that is the scenario i expected.

Before going farther let me state - i am not a DBA. I am a C++ developer who writes a lot of database code (ODBC and OLE DB), but does not know all the ins and outs of SQL Server.

I had the same issue a couple years ago.
I wanted my server application to be aware of any changes made to certain tables by other applications.

What i ended up doing is writing a couple extended procedures for SQL Server.

Given:
Machine S contains my server program.
Machine D contains SQL Server.
The extended procedures are all contained in x.dll which has been installed on D.

My server on S, using ODBC, connects to MSSQL on D after setting up a listening port on S.
It then executes (via ODBC statement) 'xp_cmkInitSvcMsg <@server> <@port> [@handle OUTPUT]'.
The output handle uniquely identifies the MSSQL connection to S.

The triggers on the tables then call 'xp_cmkBroadcastSvcMsg <@msg>' when modified.
This sends @msg to all connected servers (i.e. those that called xp_cmkInitSvcMsg).

Just before the server on S disconnects from MSSQL on D it executes 'xp_cmkTermSvcMsg <@handle>'.
This just closes the socket connection from MSSSQL to S and cleans up the state.

As long as the server is connected it gets messages from MSSQL on its listening port.
It also allows more than one program to get change messages from MSSQL at the same time.
It's a bit of a round about way of doing things, but i needed a solution and this was the best i came up with.


...cmk

Save the whales - collect the whole set
GeneralRe: Trigger Dates Pin
Tom Wright1-Feb-05 11:11
Tom Wright1-Feb-05 11:11 
GeneralRe: Trigger Dates Pin
cmk1-Feb-05 16:47
cmk1-Feb-05 16:47 
GeneralRe: Trigger Dates Pin
Tom Wright2-Feb-05 4:39
Tom Wright2-Feb-05 4:39 
GeneralConnecting to the remote Sqlserver instance. Pin
RuchirD31-Jan-05 3:05
RuchirD31-Jan-05 3:05 
GeneralRe: Connecting to the remote Sqlserver instance. Pin
David Salter31-Jan-05 8:54
David Salter31-Jan-05 8:54 
GeneralRe: Connecting to the remote Sqlserver instance. Pin
RuchirD31-Jan-05 16:25
RuchirD31-Jan-05 16:25 
GeneralRe: Connecting to the remote Sqlserver instance. Pin
David Salter1-Feb-05 9:09
David Salter1-Feb-05 9:09 
GeneralRe: Connecting to the remote Sqlserver instance. Pin
RuchirD1-Feb-05 16:23
RuchirD1-Feb-05 16:23 
GeneralJOIN tables in different databases Pin
Just Greeky Creek30-Jan-05 22:27
Just Greeky Creek30-Jan-05 22:27 
GeneralRe: JOIN tables in different databases Pin
Colin Angus Mackay30-Jan-05 23:14
Colin Angus Mackay30-Jan-05 23:14 
GeneralRe: JOIN tables in different databases Pin
Just Greeky Creek31-Jan-05 3:54
Just Greeky Creek31-Jan-05 3:54 
GeneralRe: JOIN tables in different databases Pin
Colin Angus Mackay2-Feb-05 3:04
Colin Angus Mackay2-Feb-05 3:04 
GeneralSQL transaction rollback and commit Pin
ppp00130-Jan-05 21:54
ppp00130-Jan-05 21:54 
GeneralRe: SQL transaction rollback and commit Pin
David Salter31-Jan-05 7:28
David Salter31-Jan-05 7:28 
GeneralCrosstab in SQL Server 2000 Pin
ColdWaterBlue30-Jan-05 10:51
ColdWaterBlue30-Jan-05 10:51 
GeneralRe: Crosstab in SQL Server 2000 Pin
Colin Angus Mackay30-Jan-05 12:45
Colin Angus Mackay30-Jan-05 12:45 
GeneralNeed your help on SQL learning. Pin
denniskang200430-Jan-05 7:19
denniskang200430-Jan-05 7:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.