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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:43:40+00:00 2026-05-19T03:43:40+00:00

Given a column structure in a CSV file of: First_Name, Last_Name, Date_Of_Birth And a

  • 0

Given a column structure in a CSV file of:

First_Name, Last_Name, Date_Of_Birth

And a SQL Server table with a structure of

ID(PK) | First_Name | Last_Name | Date_Of_Birth

(Field ID is an Identity with an auto-increment of 1)

How do i arrange it so that SQL Server does not attempt to insert the First_Name column from the csv file into the ID field?

For info the csv is loaded into a DataTable and then copied to SQL Server using SqlBulkCopy

Should i be modifying the csv file before the import add the ID column (The destination table is truncated prior to import, so no need to worry about duplicate key values.) Or perhaps adding an id column to the Datatable?

Or Is there a setting in Sql Server that i may have missed?

  • 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-19T03:43:40+00:00Added an answer on May 19, 2026 at 3:43 am

    You should add the ID column to the datatable, but do not worry about populating that field with data from the CSV.

    Once that is done the data should line up fine and since ID is a Identity with Auto-Increment you should be fine with loading the CSV into the DB.

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

Sidebar

Related Questions

Given the following simple table structure (SQL Server 2008), I want to be able
Given the following XML (in an SQL column field called 'xfield'): <data> <section> <item
I have a SQL Server table with the following structure: CREATE TABLE [dbo].[Log]( [LogID]
Given a table where the first column is seconds past a certain reference point
Given a number, how do I discover in what table and column it could
Given this table structure, I want to flatten out the many-to-many relationships and make
While implementing a tree structure over a SQL 2005 server database, the query response
Given the following table structure: id iata icao name 1 ANC PANC Anchorage -
Given an input xml file with following structure: <root> <record row=1 col=1 val=1 />
I have a table in SQL Server 2000 that I am trying to query

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.