Native Bcp file is converting special characters in the column value

ssalun 26 Reputation points
2020-08-20T20:25:13.447+00:00

Hi,

I am generating bcp file in Sybase ASE with -n (native) and delimiter "|" and trying to load in SQL SERVER 2016. I know native file is not compatible with MSSQL Server . Is there any way or option i should explore to handle special characters in the column value and date fields?

Please advise.

Thanks.

Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,589 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 104.8K Reputation points MVP
    2020-08-20T21:30:49.967+00:00

    If you know that native format is not compatible, why do you use it? :-)
    I can't but see that you need to use character format.

    When it comes to special characters, you don't give any example of what is special to you. But one thing that can be problematic with bulk load is code pages.

    I have an article on my web site, http://www.sommarskog.se/bulkload.html, which may be helpful to you., even if I'm not covering Sybase, only MS SQL Server.

    1 person found this answer helpful.
    0 comments No comments

  2. MelissaMa-MSFT 24,176 Reputation points
    2020-08-21T02:48:06.233+00:00

    Hi Swapnil,

    What kind of special character do you have?

    You could consider using SSIS to handle special character. Refer How to handle special characters with SSIS?

    You could also try with Character Format, even Unicode Native Format and Unicode Character Format.

    Besides, you could use the -C option to control the code page and try with others like ANSI.

    If the response is helpful, please click "Accept Answer" and upvote it.

    Best regards
    Melissa

    0 comments No comments