简体   繁体   中英

SQL Server 2012 -SSIS- Problems querying string from unicode only culture

I am new to dealing with languages in SQL Server and this forum...

The following query:

SELECT [CultureCode], [Target]
FROM [Str].[dbo].[LatestReversal]
where [Target] = N''

CultureCode | Target

am-ET | ማዕከላዊ የብራዚል የቀን ብርሃን ጊዜ

am-ET | ፓስፊክ የቀን ብርሃን ጊዜ ...


Expected: The query in the code snippet is to a table that forms the first step of an ETL process. Using this query I would expect to see only rows returned have empty strings.

Result: However I am returned 900+ rows of that have a value for the field Target. All these strings are from Unicode only cultures ie windows does not have a specific code page for them. Can someone explain why this is happening?

  1. The CSV file was UTF8 and I have tried Unicode format.
  2. The SSIS job uses NText for the Source and Destination connection data types (no conversion)
  3. The Target field in the DB is nvarchar(Max)

Later in the process I try to process a cube allowing for failures. The exact same strings fail the load process.

Any help appreciated. Even with pointers on other special handling I would need to apply for these cultures.

Cheers,

Seamus

you can simply use IS NULL function to retrieve only empty strings for target field...

  SELECT [CultureCode], [Target]
  FROM [Str].[dbo].[LatestReversal]
   where [Target] IS NULL;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM