hazydavy
Starting Member
3 Posts |
Posted - 2008-05-30 : 19:46:31
|
Hello.I am seeing some behaviour I don't understand. I can't believe it hasn't been discussed here before, but my searches have returned nothing.Here it is.I have a CSV file. Its first rows look like this:# 3_results/ABC.csv# Created from data/clean/# OS Unix, host smac.local, user gecol1,col2,col3,col4,col5,col6,col7,col8,col9,col10,col11,col12,col13 38, 2008-05-05 14:35:05, 92,0,0,FFF,1,0,1,0,1,0,0 41, 2008-05-05 14:35:10, 4,1,0,GGG,1,0,0,1,0,0,0 75, 2008-05-05 14:35:26, 2,1,0,HHH,1,0,0,1,0,0,0 183, 2008-05-05 14:35:26, 4,1,0,III,0,0,0,0,0,1,0 347, 2008-05-05 14:35:28, 11,0,0,JJJ,0,0,0,0,0,1,0 365, 2008-05-05 14:35:28, 0,1,0,KKK,0,0,0,1,0,0,0 41, 2008-05-05 14:35:29, 18,0,0,LLL,1,0,0,1,0,0,0 286, 2008-05-05 14:35:30, 3,1,0,MMM,0,0,0,0,1,0,0So, there are three lines of miscellaneous information, one line of column names, and the data to be imported begins on row 5.So I import with this:BULK INSERT tableName FROM 'file.csv' WITH (FIELDTERMINATOR = ',',FIRSTROW = 5)And the first line to be imported is the one beginning with 183!This does what I want:BULK INSERT tableName FROM 'file.csv' WITH (FIELDTERMINATOR = ',',FIRSTROW = 2)I can insert as many lines starting with # as I want and it works fine.What is going on?Thanks. |
|