Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - DB export/import
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DB export/import

 Post Reply Post Reply
Author
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Topic: DB export/import
    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?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.