I have a strange behavior when inserting multiple rows in a table with mixed types in the values.
The SQL for creating the table is:
CREATE TABLE [dbo].[insert_test]
(
[col1] [nchar](10) NULL
) ON [PRIMARY]
When inserting multiple values (with mixed types) I get an error:
INSERT INTO insert_test (col1)
VALUES ('test'), (1);
Error:
Conversion failed when converting the varchar value 'test' to data type int.
I do not see, why the server is trying to convert 'test' to an int.
I would expect, that it uses the type of the column I'm using (in this case nchar
from column col1
).