Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 50891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:39:52+00:00 2026-05-10T16:39:52+00:00

I need to import a large CSV file into an SQL server. I’m using

  • 0

I need to import a large CSV file into an SQL server. I’m using this :

BULK  INSERT CSVTest         FROM 'c:\csvfile.txt'             WITH     (                 FIELDTERMINATOR = ',',                 ROWTERMINATOR = '\n'     ) GO 

problem is all my fields are surrounded by quotes (‘ ‘) so a row actually looks like :

'1','','2','','sometimes with comma , inside', ''  

Can I somehow bulk import them and tell SQL to use the quotes as field delimiters?

Edit: The problem with using ”,” as delimiter, as in the examples suggested is that : What most examples do, is they import the data including the first ‘ in the first column and the last ‘ in the last, then they go ahead and strip that out. Alas my first (and last) column are datetime and will not allow a ‘20080902 to be imported as datetime.

From what I’ve been reading arround I think FORMATFILE is the way to go, but documentation (including MSDN) is terribly unhelpfull.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T16:39:52+00:00Added an answer on May 10, 2026 at 4:39 pm

    I know this isn’t a real solution but I use a dummy table for the import with nvarchar set for everything. Then I do an insert which strips out the ‘ characters and does the conversions. It isn’t pretty but it does the job.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 196k
  • Answers 196k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer <link rel="stylesheet" type="text/css" href="ColumnLayout.css" media="all"/> I am assuming ColumnLayout.css and… May 12, 2026 at 7:10 pm
  • Editorial Team
    Editorial Team added an answer Okay, so here's what I found about sandboxing code with… May 12, 2026 at 7:10 pm
  • Editorial Team
    Editorial Team added an answer There are no server controls and server-side events in ASP.NET… May 12, 2026 at 7:10 pm

Related Questions

I need to import a large CSV file into an SQL server. I'm using
I was using a not-so-up-to-date version of OOo.calc (Open Office Spreasheet component, version 2.04,
I have a bunch of pretty large CSV (comma separated values) files and I
I have several large csv files with thousands of columns that I need to
I'm importing data from a CSV that contains approx 350 columns. This CSV import

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.