Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 inserting data with identity

Author  Topic 

cDc
Starting Member

30 Posts

Posted - 2003-06-03 : 04:20:18
Hi
Hope someone can advise on this I am designing a new database that will hold a fairly large number of products (~500000). I was reading the microsoft article located here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnduwon/html/d5schmdsgn.asp that describes the schema used for their "duwamish online" database.

Looking at this diagram a main product catalog is created using some vendor supplied data by inserting a type and description into the Items table, and this has an identity field.

I would like to adapt this design for my own use, and have several databases of products supplied by various vendors that I intend to import into my database all of which have some sort of unique key already.

My question is how would one perform the initial insert of data into the Items table yet preserving the foriegn key itemid in the "item details" set of tables?

hope that made sense
thanks
chris.

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-06-03 : 09:19:30
I am not quite sure what you are trying to say here, but I think you have an IDENTITY column in the Items table, that is your primary key - ItemID. But you want to import existing data into the table, with the existing primary keys. Is that what you mean? In that case, look at the SET IDENTITY_INSERT <table_name> ON|OFF setting in the Books Online.

Owais

Go to Top of Page
   

- Advertisement -