473,661 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update and append data in one table from data in another table

62 New Member
Hello -

I have a local table in my database called t_CompanyData that holds a subset of the fields in another table called dbo_INT_AUX_LIS TING.

dbo_INT_AUX_LIS TING is a linked table via an ODBC connection. This is a table in our CRM system and the data in that table is updated constantly.

I need to run a query to:
1 - update the data in t_CompanyData with any updated data for related records in dbo_INT_AUX_LIS TING

2 - append any NEW records in dbo_INT_AUX_LIS TING to t_CompanyData
I wrote an query that updates data and adds any new records using the strategy at
http://support.microsoft.com/kb/127977

New records are being added to t_CompanyData. However, the value in dbo_INT_AUX_LIS TING.LISTING_ID field is not being added to t_CompanyData.IA_CompanyLIST ING_ID.

I have verified that the LISTING_ID field in the dbo_INT_AUX_LIS TING table is a NUMBER datatype (not autonumber). It is a primary key.

Expand|Select|Wrap|Line Numbers
  1. UPDATE (dbo_INT_AUX_LISTING LEFT JOIN t_CompanyData 
  2. ON dbo_INT_AUX_LISTING.LISTING_ID = t_CompanyData.IA_CompanyLISTING_ID) 
  3. LEFT JOIN dbo_INT_AUX_DIRECTORY 
  4. ON dbo_INT_AUX_LISTING.OWN_DIR_ID = dbo_INT_AUX_DIRECTORY.DIRECTORY_ID 
  5.  
  6. SET t_CompanyData.IA_CompanyLISTING_ID = [dbo_INT_AUX_LISTING].[Listing_ID], 
  7. t_CompanyData.COMPANY_NM = [dbo_INT_AUX_LISTING].[Company_NM],
  8. t_CompanyData.DIRECTORY_NM = [dbo_INT_AUX_Directory].[directory_NM];
  9.  
Any suggestions greatly appreciated.
Sandra
Jan 19 '12 #1
8 2438
NeoPa
32,568 Recognized Expert Moderator MVP
The settings of t_CompanyData.I A_CompanyLISTIN G_ID are of far more interest Sandra ;-) If this is an AutoNumber field for instance, it would fail.

PS Congrats on a well prepared question. Such quality from newbie posters is as rare as the proverbial R-H S.
Jan 20 '12 #2
Sandra Walsh
62 New Member
Thanks, NP ;)

t_CompanyData.I A_CompanyLISTIN G_ID is a number - long integer.

Any other clues I can send along?
Jan 20 '12 #3
NeoPa
32,568 Recognized Expert Moderator MVP
I'm grasping at straws here Sandra, but is it involved as a foreign index to another table maybe? Does it feature in the Relationships diagram?

Frankly I'm surprised at the described behaviour.
Jan 20 '12 #4
Sandra Walsh
62 New Member
dbo_INT_AUX_LIS TING is not part of the Relationships diagram.

Here are a few images - hope this helps.





Jan 20 '12 #5
Rabbit
12,516 Recognized Expert Moderator MVP
Why store the company name and directory name if they're already stored in the other tables? When you need them, you can just join the tables together.
Jan 20 '12 #6
Sandra Walsh
62 New Member
When I first set up this database it was taking a very long time to load the data from the ODBC tables. They have done some upgrades to our servers and now things are nice and fast.

I think it may be best for me to re-configure the back end to get data directly from the ODBC tables instead of going through this update/append process. Hopefully this wont be too much of a hassle :-)

Thanks all!
Jan 20 '12 #7
NeoPa
32,568 Recognized Expert Moderator MVP
I see the relationship, but I cannot think of anything that would explain the bahaviour. Even if all the restrictions are set up the value, by definition, must be a valid one as it's the same as the one it's linked to (having been copied from it). I don't know the problem I'm afraid.
Jan 20 '12 #8
Sandra Walsh
62 New Member
Thanks NP - maybe some issues with the install. I have been having other strange problems so I might re-install Access.
Jan 20 '12 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

9
19603
by: Deja User | last post by:
This is probably very simple but I can't figure out a way to update one table from another table. Here is an example: ------ TABLEA ------ first_name last_name
3
1516
by: Yakimo | last post by:
Hi I am trying to append some records form tmpSource to tmpDest table using datasets Tables tmpSourec and tmpDest are identical. My setup is the following: - daSource - data adapter for source table - daDest - data adapter for Dest table (containing select, update, delete and
1
31131
by: Mike9900 | last post by:
What is the best way to copy DataRow from one table to another table, without copying its structure, which means copying only its data. -- Mike
1
1727
by: thengfen | last post by:
Hi! Im having a problem in transfering a set of records from a table to another table. The scenario is when i select combo box (Course taken such as diploma in IT), then the process will automatically save the list of subjects that need to be taken by students into student course info table.. i hv link all the related table together... I had tried a few solution but still cant... Hope somebody can help.... Thanks a lot! :)
3
8063
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we incur numerous service problems “Events”. Each morning we have a global conference call where events which occurred within the previous 24 hours are discussed. Prior to the call, an analyst has to review these events and provide a report, ‘The Morning...
1
1989
by: Sakakini | last post by:
How can I append last entry from one table to another table???
4
4844
by: xoozlez | last post by:
Hi there, How do I insert new records from a dbo table to another table? This is what I have: 1 dbo_company 1 Member (table) I made a query in dbo_company with the criteria I only want to retrieve out new records from "ceo_email" and "contact_email" column after e.g 25.July.07
3
2590
by: anil2083 | last post by:
How to migrate the comma separated values from one table to another table? suppose we have table i.e XYZ and we have comma separated values in few columns i.e( column_name and values are A,B,C,D).Now i have to migrate these comma separated values into new table i.e PQR. Example: Table1 column_name1 complexion values : VF,F,AVG etc.. column_name2 profession values : TEA,LECT etc...
3
2697
by: shubham rastogi | last post by:
hello guys I want to copy or insert records into the previously created table from another table.. For example I have two tables A and B .... I want to copy or insert records from table B into table A .... But here is a little problem, table A has some records that I don't want to be overwritten by the records that are being copied or inserted from table A .... infact I want that all these records that are being copied from tabe B into...
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8754
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8542
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6181
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4177
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1740
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.