?
Solved

Vb.net Update all modified records in a remote database

Posted on 2009-05-11
3
Medium Priority
?
294 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

800 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