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 7180885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:26:32+00:00 2026-05-28T17:26:32+00:00

1) Can I do a BulkInsert from a CSV file, into a table, such

  • 0

1) Can I do a BulkInsert from a CSV file, into a table, such that the table has an identity column that is not in the CSV, and gets automatically assigned?

2) Is there any rule that says the table that I’m BulkInsert’ing into, has to have the same columns in the same order as the flat file being read?

This is what I’m trying to do. Too many fields to include everything…

BULK INSERT ServicerStageACS  
   FROM 'C:\POC\DataFiles\ACSDemo1.csv' 
   WITH (FORMATFILE = 'C:\POC\DataFiles\ACSDemo1.Fmt');
GO
SELECT * FROM ServicerStageACS; 

Error:

Msg 4864, Level 16, State 1, Line 3 Bulk load data conversion error
(type mismatch or invalid character for the specified codepage) for
row 1, column 1 (rowID).

I’m pretty sure the error is because I have an identity.

FMT starts like this:

9.0
4
1       SQLCHAR       0       7       ","      1     Month        SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR       0       100     ","      2     Client       SQL_Latin1_General_CP1_CI_AS
  • 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-28T17:26:33+00:00Added an answer on May 28, 2026 at 5:26 pm

    A co-worker recommended that it was easier to do the bulk insert into a view. The view does not contain the identity field, or any other field not to be loaded.

    truncate table ServicerStageACS
    go
    BULK INSERT VW_BulkInsert_ServicerStageACS  
       FROM 'C:\POC\DataFiles\ACSDemo1.csv' 
       WITH
            (
            FIELDTERMINATOR = ',',
            ROWTERMINATOR = '\n'
            )
    
    GO
    SELECT * FROM ServicerStageACS; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stored procedure called sp_BulkInsert that inserts one .csv file into my
Can a LINQ enabled app run on a machine that only has the .NET
Can anyone recommend a good library for generating an audio file, such as mp3,
The web application I'm currently developing supports CSV export from (using SELECT INTO OUTFILE)
I need to import a large CSV file into an SQL server. I'm using
I am trying to insert a .csv file into a database with unix linebreaks.
Hi I have a csv file (coming from excel), and I use BULK INSERT
I'm using SqlBulkCopy to bulk insert some records from one table into another table.
I am using a bulk insert to import data from a CSV file. One
I am trying to insert a .csv file into SQL Server 2008 R2. The

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.