dodgerfan
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.