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)
 Insert multiple rows into tables with joins

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-12-06 : 10:07:44
Craig writes "I am a bit inexperienced so please bear with me.

How do I perform batch inserts into a table that contain foreign keys to other tables? For example: if I have a name table and a gift table and a giftreceive table (to show gifts given to an individual), with appropriate keys for joins, how can I perform multiple row inserts in to the gift receive table? I am having problems figuring out how to make sure the field with the key to the name table is inserted along with the gift.

I am sure SQL server makes this easy but I do not know how to use this functionality.

Thanks."

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-12-06 : 19:21:05
Does this help ?

http://www.sqlteam.com/item.asp?ItemID=277

Use a select statement to select the fields the way you want them, then prefic it with an insert statement.



Damian
Go to Top of Page
   

- Advertisement -