I use the following MS SQL Query to import a text file containing Comma Separated Values into DB:
BULK INSERT logs
FROM 'E:\Sample.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
Unfortunately, one of the fields in my CSV Text file contains messages like: "Problem in UDP ports(234,137)" which contains comma within itself. Hence, the DB takes values before comma as one field and inserts the value after comma into the next field (which is logically incorrect). As a result, the legitimate value of the latter field gets discarded while getting inserted into the table.
Hope my problem is best explained.
Any solutions to overcome this problem and store the whole:"Problem in UDP ports(234,137)" into a single field?