473,496 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Updating records across two databases

I have two databases and I am trying to do something with the Merge table in
one database and am having a little difficulty writing the logic. Basically
in DB1 I have a table which is full of records outling the merges of URNs.
Example below.

Database1
Table: MergeList
RecNo FromURN ToURN
1 200 300
2 1500 1700

These records exist in two tables in DB2. These tables look like as follows: -

Database2
Table: Party
PartyURN Type
200 1
300 2
1500 1
1700 1

Table: PartyAddress
Rec No PartyURN Add1
1 200 10 Downing St
2 1500 6 Royal Ave
3 300 114 Queens St
4 1700 8 Park Ave

What I want to do is update the records where the PartyURN values are the
same as a record in the field FromURN in DB1 in table MergeList.

I want this table updated changing the PartyURN to the new ToURN outlined in
database1. The table should look like the following.
Table: PartyAddress
Rec No PartyURN Add1
1 300 10 Downing St
2 1700 6 Royal Ave
3 300 114 Queens St
4 1700 8 Park Ave

Finally I'd like to remove the Records from the Party Table where the
PartyURN was an old FromURN value in DB1. The table should look like the
following.
Table: Party
PartyURN Type
300 2
1700 1

I would be very grateful if someone could help me to write the logic to do
this. Will I need to use a cursor or could i just use normal sql.

Cheers for any help anyone can give.
Oct 3 '05 #1
0 1116

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4316
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
6
2105
by: Damon Grieves | last post by:
Hi I just want to be sure I understand how the Access client works. If I have an Access back end with a million records on a server and an Access client. If the client is installed on the users pc...
0
196
by: Stephen | last post by:
I have two databases and I am trying to do something with the Merge table in one database and am having a little difficulty writing the logic. Basically in DB1 I have a table which is full of...
1
1491
by: davidgordon | last post by:
Hi, If I am updating a list of records for a user on an asp page, is there a way to hold the page updating, even if they refresh the page, until I have updated all the records. i.e. rather...
34
10766
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have...
1
2342
by: johnrou | last post by:
Here's a problem that I can't find anyone else has run into. I'm using Access and SQL Server, but the theory would be the same for any db. I have a large number of tables that contain linked...
3
1671
by: jason.teen | last post by:
Hi, I'm trying to update a recordset (change field values, delete records) but I have found that it actaully is changing the original tables. When when I was hoping for was actaully that the...
6
2757
by: gerbski | last post by:
Hi all, I am relatively new to ADO, but up to now I got things working the way I wanted. But now I've run into somethng really annoying. I am working in MS Access. I am using an Access...
33
3254
by: bill | last post by:
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key. (there are in the range...
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.