Print Page | Close Window

DB export/import

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=17482
Printed Date: 29 March 2026 at 9:49am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: DB export/import
Posted By: theSCIENTIST
Subject: DB export/import
Date Posted: 08 December 2005 at 3:51am
I was wondering what would be the best method to design a database table for best export/import operation.

Let me explain; I have a table that I rely heavily on it's auto insert IDs to call records, and I now need to export all data and then later import it, however if I do that, on import the IDs will be different since they will be sequential with no gaps caused by deleted records, and the whole system stops functioning.

So I was wondering if I should add a new column called [Ref_ID] and this won't be auto-generated, but then I would have the uniqueness problem.

Or should I import it to a table that has it's IDs (not auto-generated) and when all data is in, change it to primary key auto-generated ID, will this work?

Or, is there another better way?

-------------
:: http://www.mylittlehost.com/ - www.mylittlehost.com



Replies:
Posted By: michael
Date Posted: 08 December 2005 at 11:09am
This really depends on what db you are using. If you are importing the records with your Key to a SQL Server Table you can use
 Set Identity_Insert tablename ON
And then do the impot, keeping the existing identities you have.
If you use access I would use a different strategy as I believe compacting resets the auto numbers


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: theSCIENTIST
Date Posted: 09 December 2005 at 12:55am
Thanks michael, that really prompted me to look for that sort of functionality on MySQL (MyISAM) which I use, there might be something like that for it.

Apprecite any other ideas you guys may have.

-------------
:: http://www.mylittlehost.com/ - www.mylittlehost.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net