Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Vb.net Update all modified records in a remote database

Posted on 2009-05-11
3
Medium Priority
?
295 Views
Last Modified: 2012-05-06
I have a sql database in my pc and another located in a web server. I have the Charges table in both. I need to transfer from pc to online all records not payed. But i need to, mark in online database  all records payed from last update. Anyone have any sugestion.
0
Comment
Question by:rflorencio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24353678
I am not clear 100% about your goal but you can do one thing. you can add your webserver as linked server with sp_addlinkedserver, suppose you give name "MyWebSrv" to your linked server than you can set INSERT and/or UPDATE trigger to update/insert records in your web server database.

like

create trigger trig
on yourtablename
as
begin

update websrv set websrv.record1=inserted.record1
from MyWebSrv.DatabaseName as websrv
JOin
Inserted
ON websrv.field1=inserted.field1


end
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24353681
I missed one thing in trigger snippet.

create trigger trig
on yourtablename
for update
as
begin

update websrv set websrv.record1=inserted.record1
from MyWebSrv.DatabaseName as websrv
JOin
Inserted
ON websrv.field1=inserted.field1


end
0
 
LVL 57

Accepted Solution

by:
Raja Jegan R earned 2000 total points
ID: 24353697
Logic below:

1. Add one more column to the existing table and have it as 'N' by default.
2. Move the records with 'N' value from pc to online and after that update its value to 'Y'.
3. Hence the new records will be in status 'N'.
4. Next time move only records with 'N' status and repeat steps 2 - 4.

Hope this helps.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question