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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:27:42+00:00 2026-06-18T18:27:42+00:00

I have a simple BCP command to query my MSSQL database and copy the

  • 0

I have a simple BCP command to query my MSSQL database and copy the result to a .csv file like this:

bcp "select fullname from [database1].[dbo].employee" queryout  "c:\test\table.csv"  -c -t"," -r"\n" -S servername -T

The issue comes when the fullname column is varchar separated by a comma like “Lee, Bruce”. When the result is copied to the .csv file, the portion before the comma (Lee) is placed into the first column in Excel spreadsheet and the portion after the comma (Bruce) is placed in the second column. I would like it to keep everything in the first column and keep the comma (Lee, Bruce) . Does anyone have any idea how to achieve this?

  • 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-06-18T18:27:43+00:00Added an answer on June 18, 2026 at 6:27 pm

    Obviously you should set columns separator to something different than comma. I’m not familiar with the above syntax, but I guess these: -c -t"," -r"\n" are column and new line separators respectively.

    Further you should either change default CSV separator in regional settings OR use import wizard for proper data placing in Excel. By the way, there are plenty of similar questions on SO.

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

Sidebar

Related Questions

i have simple question, let's say i have input like this: <input name=somename type=checkbox
I have simple ASP.NET MVC action like this : public ActionResult Edit(EditPostViewModel data) {
I have simple example: function File(name) { this.name = name this.text = null }
I have simple page, like: ... <div><?php include 'somefile.php' ?></div> ... 'somefile.php'-file contains <p>Lorium
I have simple view in my Ember.js application, like this. Each content element consists
I have simple plot like this: matplotlib.pyplot as plt pt_no = [1,2,3] coord_x =
I have simple database - one table with 6 collumns. 3 of them i
I have a small issue with using bcp import tool. This is the case
I have log files that look like this... 2009-12-18T08:25:22.983Z 1 174 dns:0-apr-credit-cards-uk.pedez.co.uk P http://0-apr-credit-cards-uk.pedez.co.uk/
I have simple query which is taking around 7-8 seconds for to retreive 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.