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

  • SEARCH
  • Home
  • 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 3977518
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:55:59+00:00 2026-05-20T04:55:59+00:00

For SQL Server 2008 R2, is it possible to import a .csv file with

  • 0

For SQL Server 2008 R2, is it possible to import a .csv file with a date in “MM/DD/YYYY” format, using “bulk insert”? Or do I have to alter my .csv file to have a format that SQL Server 2008 R2 expects?

I execute the following in Microsoft SQL Server 2008 R2:

BULK
INSERT dbo.TCsvOptionContracts
FROM 'C:\x.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n',
FORMATFILE = 'C:\format.xml',
FIRSTROW = 2
)
GO

And I get this error:

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 1 (Date).

The date in this column of the .csv file is in the form MM/DD/YYYY, i.e. “02/16/2011”.

p.s. I generated a format file with the following command, however, I didn’t see any option to specify the MM/DD/YYYY date format for the offending column:

bcp Engine..TCsvOptionContracts format nul -c -x -f C:\format.xml -t, -T
  • 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. Editorial Team
    Editorial Team
    2026-05-20T04:56:00+00:00Added an answer on May 20, 2026 at 4:56 am

    Configured the “date” column to be “smalldatetime” instead of “datetime”. Tried it, and everything imported 100%.

    There are two potential methods to do this:

    • Method 1: Discard the formatting file, it will read it in fine without it (this definitely works).
    • Method 2: If LINQ-to-Entities insists on generating a “datetime” in this column, then change the formatting file to specify “smalldatetime” so it reads in properly (havn’t tried this but I imagine it might work).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to import data from a CSV file to a SQL Server
Possible Duplicate: app.config file in C# for MS SQL Server 2005 in VS 2008
I am using SQL Server 2008. I have tables on which there are duplicate
I am using SQL Server 2008 R2. I have a table which has several
I have an SQL Server 2008 Database and am using C# 4.0 with Linq
I'm using SQL Server 2008 with Advanced Services on my Vista Home Premium. I'd
Can you import (or migrate) SQL Server 2005 databases to SQL Server 2008? Is
I am trying to import some data to SQL Server 2008 by means of
So I have a sql server 2008 database with 9 tables in them, they
Is is possible in SQL Server 2008 to create such a constraint that would

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.