Two table Insert - One 2 Many relationship

  • Thread starter Thread starter mxtreme
  • Start date Start date
M

mxtreme

Hey all,

I am looking to write an insert statement that writes one tuple fo
each product in the parent table and multiple tuples in the child tabl
for each specific product.

For instance,

Parent Table: Product
Columns: prod_id, prod_desc, prod_origin

Child Table: Product Prices
Columns: prod_id, area_code, unit_price


The origin of the data comes from one table so I need to divide th
relevant info from this table into my two tables in my database
Changing the table structure to just one table for all the data is no
really an option.

Thanx for any help.

Shaun
 
Hi,


Neither Jet, neither MS SQL Server 2000 allow multiple insert, through
the VALUES( ). You have to issue each statement, once at a time, one per
record to be added:

INSERT INTO tableName( listOfFields ) VALUES( listOfValues )



Such as :

INSERT INTO table1( f1, alpha1) VALUES( 222, 'Microsoft' )


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top