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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:27:31+00:00 2026-06-11T23:27:31+00:00

I was working trying to get this bcp tool to work in a particular

  • 0

I was working trying to get this bcp tool to work in a particular way. The -c switch is supposed to export using chars, but for some reason there was a weird char showing in Notepad++ like if it was UNICODE or some other formatting.

I wanted to get that char, which was an Empty string in the database, to export as an empty string into the text file. How do you do that?

  • 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-11T23:27:33+00:00Added an answer on June 11, 2026 at 11:27 pm

    Well, after looking around the web this is what I found. Thought to put it in SO so more people have access to it.

    http://www.techtalkz.com/microsoft-sql-server/147106-how-export-empty-strings-via-bcp.html

    But when I run bcp, the empty strings are written to the text file
    using the ASCII “NUL” character (0x0). Instead, I want the field to be
    filled with blanks (0x20).

    Solution:

    In a text file, an empty string is interpreted as NULL when you bulk
    in data. The NUL character is interpreted as the empty string, so
    there is consistency. But that does not help much if you are exporting
    data to another system….

    Simply wrap around a NULLIF that field that is possibly empty in the database and make it catch '' and replace with NULL. That will get converted into ^^values^^^^more values^^and more^^ so you get double separator with an blank instead of the NUL character.

    E.g.:

    ...
    NULLIF(pri.InstanceName, '') as PerformanceInstanceName,
    ...
    

    Hope this helps someone.

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

Sidebar

Related Questions

Hi I have been trying to get this script http://jsbin.com/ipajo5/ working but using .live()
Im trying to get this working but for some reason it's just not right.
I'm trying to get this working and the query executes but nothing comes back.
I am trying to get this code to work for me,but It is not
Im trying to get this piece of CSS working on my ipad but it
I am trying to get this example working but I do not know how
I've been trying to get this working for the last hour, but I can't
I have been trying to get this working for quite a while now but
I'm learning mysql and have been trying to get this working, but an error
I have been trying to get this android service working but I can not

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.