Link to home
Start Free TrialLog in
Avatar of dodgerfan
dodgerfanFlag for United States of America

asked on

SQL Server bulk insert of .csv file fieldterminator

I am trying to utilize bulk insert in SQL Server 2008. The data is in a .csv format. The code I've run is below:
BULK INSERT Alerts FROM 'C:\Alerts.csv'
   WITH (
      DATAFILETYPE = 'char',
      FIELDTERMINATOR = ',',
      ROWTERMINATOR = '\n'
)
The insert works, but the fields have the wrong data in several records. The problem is that a few of the fields in the .csv file have commas in the text. What would be the best fieldterminator to use in a case like this?
ASKER CERTIFIED SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial