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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:43:08+00:00 2026-05-30T22:43:08+00:00

My source CSV is comma delimited. Example Col1, Col2, Col3 Destinatin SQL Table Col1,

  • 0

My source CSV is comma delimited.

Example

Col1, Col2, Col3

Destinatin SQL Table

Col1, Col2, Col3, Col4, Col5 ( Col4 and Col5 are like audit columns)

So when i do bcp import can these Col4 and Col5 set to some default values or should I have to massage the data / source file to include these before i execute bcp cmd.

Which is preferred way.

Use SSIS to read source / derive audit columns and map to destination.

or any other right way.

  • 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-30T22:43:09+00:00Added an answer on May 30, 2026 at 10:43 pm

    I think you have a couple of options:

    1. Change the schema of your destination table to include DEFAULT constraints on the two columns that will not get updated with values from your import file (and then remove them later if you don’t need them

    2. Build an SSIS package — it would probably take about the same amount of time as it would take you searching the Interweb for a solution using bcp

    3. Try using BULK INSERT through sqlcmd.exe or SQL Server Management Studio and adding in default values (SELECT c1, c2, c3, 'My default', GETDATE() FROM OPENROWSET('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};
      DefaultDir=C:\Path\To\Folder\With\CSV;','SELECT * FROM MyCsv.csv')
      )

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

Sidebar

Related Questions

I have a CSV file that I would like to use as source data
I hava a CSV file that I want to treat as source code. Essentially
At regular intervals we are receiving CSV files from an external source that we
Can source code examples be kept in a SQL database while retaining all formatting
I have been making a program that creates multiple CSV's from another source CSV
I have a source folder which contains 4 csv files with different no of
I have a csv file as the data source. I want to create a
I am trying to generate a CSV file from DB Query as source one
I am using Postgres 8.4.4 copy, http://www.postgresql.org/docs/8.4/static/sql-copy.html , to import CSV data into my
I am trying to read a CSV file containing a line like following: test,"test,"test,test,test,test

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.