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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting several rows at once.

Status
Not open for further replies.

eja2000

Programmer
Nov 30, 2003
209
NG
can you give me an example of a query that inserts all records in a view at once..eg

insert into xxx select all from view_name (will this work???)


what happens if one of the rows in the view does not get inserted?
will the whole thing fail?

thanks
 
Yes, the query sample you provided will work providing that the columns in the table match the columns being outputted by the view.

When doing a multi-row insert you are inserting all the rows in a single transaction. Because of this if one row fails the entire transaction is rolled back, and none of the rows are inserted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top