A
A
Andrey2015-07-31 19:53:05
PostgreSQL
Andrey, 2015-07-31 19:53:05

Is it possible to change a value in a PostgreSQL table using a trigger in MS SQL?

Hello.
There are two programs on different servers:
1. Runs on MS SQL server DBMS.
2. Powered by PostgreSQL DBMS.
Access details to both databases are available.
Task: using only the capabilities of the DBMS, it is necessary to change the value in the DB table 1 when changing the value in the DB table 2.
Question: is it possible to change the value in the PostgreSQL DB table when a trigger fires in the MS SQL DB table and vice versa?
If this is possible, please provide an example.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Naves, 2015-07-31
@Naves

On the server with MSSQL, install the ODBC driver for postgre. The bit depth (32 or 64) of the programs must match.
Create on MSSQL linked server using OLE DB Provider for ODBC Drivers and the above driver.
https://msdn.microsoft.com/ru-ru/library/ff772782(...
www.postgresonline.com/journal/archives/46-Setting...
Write the code you need, indicating the table located on the linked server.
In theory so.
In practice, there can be various rakes from access rights to table parameters.
Also, the speed of such a trigger with a linked server can drop significantly.
Another way
Write CLR SQL Server Trigger
https://msdn.microsoft.com/en-us /library/938d9dz2(...

P
Pavel Vasterov, 2015-07-31
@zxc80

One question, what do you mean by "SQL trigger"?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question