10 TIPs - To Become a Good Developer/Programmer
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Hold On
1.2k
1k
182.9k
Fetch Data From Local Machine DB and Insert To Other Machine DB
Jul 14 2020 5:42 AM
I need to fetch data from my laptop (Postgresql) and insert that to the main server (in a different machine) using also a PostgreSQL. In MSSQL I normally do this:
BEGIN
TRY
BEGIN
TRANSACTION
INSERT
Main_Server.databasename.tbltransactions
SELECT
*
FROM
Local_Server.databasename.tbltransactions
WHERE
synchronized
IS
NULL
UPDATE
Local_Server.databasename.tbltransactions
SET
synchronized = GETDATE()
WHERE
synchronized
IS
NULL
COMMIT
TRANSACTION
END
TRY
BEGIN
CATCH
ROLLBACK
TRANSACTION
RAISERROR(
'There was a problem connecting to the server database. The connection was lost.'
,16,1)
END
CATCH
I need to do it using a SQL Transaction. Thank you in advance if you can show or point me to the right direction. I am very newbie in PostgreSql.
Reply
Answers (
4
)
Ms Access Welcome Name Display
Windows Server Reboot search in splunk