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 an array of values to a table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-15 : 13:07:28
Safari writes "I have an array of values and I want to insert them to a table with only one INSERT statement. How can I do that?

For examples,
my array: (3,'a value'), (3, 'another value'), (4, 'avalue')
I usually use three INSERT statement:
INSERT INTO mytable(myID, myText) VALUES(3, 'a value')
INSERT INTO mytable(myID, myText) VALUES(3, 'another value')
INSERT INTO mytable(myID, myText) VALUES(4, 'avalue')

How can I insert into the array with only one INSERT statement?"
   

- Advertisement -