Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert multiple records w/o select subquery

Status
Not open for further replies.

cossiboon

Programmer
Dec 12, 2000
25
US
Hello.
Hopefully somebody has an answer to this.

My website imports a list of contacts from a tab delimited file and sets all the data into an array. I then loop through that array and insert each contact using a stored procedure.

I'm curious if there is a way to insert the whole array with one insert statement, but at the same time get the id field generated for each array item.

Anybody?

Here's the ASP code:
for i=0 to ubound(aryList,1)
strQuery = "EXEC Create_Insert_User " &_
"'" & replace(aryList(i,0),"'","`") & "'," &_
"'" & replace(aryList(i,1),"'","`") & "'," &_
"'" & replace(aryList(i,2),"'","`") & "'," &_
"'" & replace(aryList(i,3),"'","`") & "'"
set objRUsrID = objCnn.Execute(strQuery)
aryUsrId(i) = objRUsrID("id").value
next
 
I am about 99% certain the answer here is NO

(at least not wihtout significant coding wihtin a stored proc and it would probably run slower than what you have now)

HTH

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top