mysql multiple insert - what happens on error?

Posted by aviv on Stack Overflow See other posts from Stack Overflow or by aviv
Published on 2010-03-16T15:50:42Z Indexed on 2010/03/16 15:51 UTC
Read the original article Hit count: 285

Filed under:
|
|
|

What happens in mysql multiple records insert during an error. I have a table:

id  | value
2   | 100
UNIQUE(id)

Now i try to execute the query:

INSERT INTO table(id, value) VALUES (1,10),(2,20),(3,30)

I will get a duplicate-key error for the (2,20) BUT... Will the (1,10) get into the database? Will the (3,30) get into the database?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about insert