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

x
?
Solved

Access Database - Manually changing xid value

Posted on 2016-10-08
7
Medium Priority
?
89 Views
Last Modified: 2016-10-09
Hi Experts

I have got an access database file which has got 2 tables in named Table A and Table B inside it. Both of them have got xid columns in them which gets created automatically, when data comes inside these tables from an external application.

Now the problem that I am facing is that there is a gap of One Day Data in the Table A, which I have to fill  by taking up the data for that same Day, from the Table B. All the columns in both the tables match perfectly, other then the xid value.

Please suggest me some method, by which I can pick up the data from Table B for date 25 May 2016, and INSERT that into the Table A, in the PROPER LOCATION, means that this data should automatically come in at the location or Row Number, where the data from the previous date of 24 May 2016 ENDS.

While doing this data import, I need to make sure that the xid column values gets modified appropriately and there are no duplicates xid values etc.

Is there some easy method to do such a thing ? Please provide some suggestions. If you need I can create a small sample database having both the tables and upload the same.

I am using the following software versions -
Microsoft SQL Server Management Studio version-  12.0.2000.8,
Microsoft Office 2016 x64
and Windows 7 x64

Thanks

PS: The main thing is that when I do the import into the Table A, then the data should go into proper location of row number that starts after the last row of 24 May 2016.
AND the xid column values should get updated automatically, so that there are no gaps or duplicates etc. in the overall xid column of Table A.
Any method which fulfills these 2 conditions, is fine for me.

I am ready for any methods, even if that involves deleting all the data from Table A, after date 24 May 2016, then importing the data of gap date 25 May 2016, and then importing back all the data for all the dates from 26 May 2016 onward. Although this method would be much more tedious, but if there is no other way, then I am ready for doing it, if that will solve the xid column sequence issue.
0
Comment
Question by:happy 1001
[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
  • 4
  • 3
7 Comments
 
LVL 22
ID: 41835014
assuming xid is an AutoNumber, you are not allowed to change its values.  Better to sort by data in the table.

To find MISSING data, you need to compare against a list that has all the data. When do your dates start? How long will they continue? Is there (/supposed to be) one record for each day?

Why is information going into 2 tables? Is this information already imported and not something that will change in the future?
0
 

Author Comment

by:happy 1001
ID: 41835028
Thanks for your reply.

I already have the data that is missing from Table A, into the Table B for the date of 25 May 2016. The problem is that this data has got different xid values for that data.

I need to import it into Table A, at the right place, after 24 May 2016, and somehow correct the xid column values into it.

Looking for a way, by which xid values can be changed in this manner. Any ideas are welcome.
0
 
LVL 22
ID: 41835030
is xid AutoNumber? what is the data type?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:happy 1001
ID: 41835112
Yes, your assumption is Correct. xid is AutoNumber. In Data Type it also says AutoNumber. It is like this -
56063
56064
56065
and so on

Thanks and regards
0
 
LVL 22

Accepted Solution

by:
crystal (strive4peace) - Microsoft MVP, Access earned 2000 total points
ID: 41835173
if there will be no more records added, then you can change AutoNumber to Long Integer data type.  If it stays AutoNumber, its values canNOT be changed.

The purpose of an AutoNumber is a unique identifier.  If you want the sort order to be different, you should use another field(s) to do that.
0
 

Author Comment

by:happy 1001
ID: 41835759
Thank you crystal.
0
 
LVL 22
ID: 41835844
you're welcome ~ happy to help
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

609 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