Hi
How can I BULK INSERT from a file that does not have the same number of columns (fields) in each line?
Say my file looks like
------------------------------------------
a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
b,,,b
c,c,,,,,c,,,,,,,,,,
------------------------------------------
I've tried
------------------------------------------
BULK INSERT #Mytable FROM 'Myfile' WITH (FIRSTROW=1,FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')
------------------------------------------
But that does not work (the lines are mixed up as if the ROWTERMINATOR statement was ignored).
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
How can I BULK INSERT from a file that does not have the same number of columns (fields) in each line?
Say my file looks like
------------------------------------------
a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a,a
b,,,b
c,c,,,,,c,,,,,,,,,,
------------------------------------------
I've tried
------------------------------------------
BULK INSERT #Mytable FROM 'Myfile' WITH (FIRSTROW=1,FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')
------------------------------------------
But that does not work (the lines are mixed up as if the ROWTERMINATOR statement was ignored).
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'