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
 Transact-SQL (2000)
 multiple record insert

Author  Topic 

nic
Posting Yak Master

209 Posts

Posted - 2002-10-02 : 17:30:31
This might be an easy answer but I don't really know. Is there a way to do a multiple record insert in one pass? If I have a list of accounts for a user, is there a way with one sql statement to insert multiple records.

user_key = 1
account_keyList = 'A','B','C','D'

tblUserAccount
user_key int
account_key varchar

In the past, I have passed the values to a sproc that would break down the list into an array and execute an insert statement for each account, BUT there might be an easier way....

Thanks

Nic

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-02 : 17:34:46
Yes:

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

Go to Top of Page
   

- Advertisement -