Solved

SQL Server bulk insert of .csv file fieldterminator

Posted on 2015-01-06
1
251 Views
Last Modified: 2015-01-12
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?
0
Comment
Question by:dodgerfan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 26

Accepted Solution

by:
Shaun Kline earned 500 total points
ID: 40534274
If you have the ability to change the delimiter in the .csv file, use either tab delimited or pipe delimited (|).
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MSSQL join different row from other table 14 65
Database maintenance 36 100
SQL- GROUP BY 4 22
Trouble installing msi file with msiexe.exe 2 16
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question