You are here: Re: Inserting multiple records into two tables...with a twist « MsSQL Server « IT news, forums, messages
Re: Inserting multiple records into two tables...with a twist

Posted by Ed Murphy on 02/01/08 02:41

--CELKO-- wrote:

>>> So, I need to insert the records into A, collect the ID and then insert into B. I have no problem doing this for individual records; I am not sure what the best way to this is for multiple records being inserted at the same time. <<
>
> What do you mean "collect the ID"? In a relational DB, the key is a
> subset of the attributes of the entity, an inherent part of it and not
> something you let the hardware create when you insert a row. Next, a
> table, which is nothing like a file; it is the set of one and only one
> kind of entity. Thus having the same data in two tables is a
> violation of basic RDBMS design -- redundancy is to be avoided via
> Normal Forms and other design methods.

It sounds like he intends B to have a foreign key referencing A.

Also, one of these days, I really do need to write that "what do 'rows
are not records' and 'columns are not fields' actually mean?" FAQ.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация