bulkinsert - SQL Server BULK INSERT: why "The FIRSTROW attribute is not intended to skip column headers"? -


here https://msdn.microsoft.com/en-us/library/ms188365.aspx can read that:

the firstrow attribute not intended skip column headers. skipping headers not supported bulk insert statement. when skipping rows, sql server database engine looks @ field terminators, , not validate data in fields of skipped rows.

but this. why not intended? can expect problems when skip headers firstrow = 2?

the sql server database engine looks @ field terminators

that's answer. if column headers have names include field terminators, system find wrong number of fields in first line, , great hilarity ensue. can imagine in world's files, column had

years, since 1970 

as header. clear enough human, machine has rules.

in case you're not aware, bulk insert fail in general case csv files. csv format quite variable, , more complex bulk insert can interpret correctly. specifically, there quoting rules allow commas included among data. sql server won't honor quotes. interpret comma separator regardless. man says,

the sql server database engine looks @ field terminators


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -