Hello all,I have encountered following problem lately:when an insertion script is done via [code="sql"]INSERT INTO myTable (col1,col2,col3) VALUES ('TEST1','TEST2',NULL) [/code]the value NULL will be somehow automatically embedded in square brackets thus making the statement invalid.In this case the insert script looks like this and thus fails: [code="sql"]INSERT INTO myTable (col1,col2,col3) VALUES ('TEST1','TEST2',[NULL])[/code]What we have is actually a situation where the values are provided from "outside" (a CSV flat file) and there are placeholders in the insertion script, so that the script looks actually sth. like this:[code="sql"]INSERT INTO myTable (col1,col2,col3) VALUES (@Placeholder1,@Placeholder2,@Placeholder3)[/code]col3 where @Placeholder3 value should be written is a nullable varchar(254) field.I have made sure that value in @Placeholder3 is indeed a NULL value (=there is no process in between that would embed the NULL value in square brackets before insert script is executed)[b]And now the part that is really confusing:[/b] when the script is run on one particular SQL server (2014) with exactly the same CSV file it would run without issues (NULL will not be embedded in square brackets)?! On other SQL Server (also 2014) it would fail due to described embedding.So it boils down to the fact that there must be(?) some kind of setting or configuration on SQL Server instance that does this embedding of NULL?Has anybody encountered this before and can point me in the right direction?Many thanks for any hints, Marin
↧