Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.


I am working on a task migrate Sybase SQL anywhere 10.0.1 to MS SQL Server 2008

When I use upload command in SQl AnyWhere 10 to export data from table which having Unicode character set like Arabic character set '^^^Arabic^كلقفظغمشسرئب'. After exporting into text file, it was 'كلقفظغمشسرئب^Arabic^^^'. It means it is reading from right to left and writing as it is.

While importing this file to SQL server, it was writing to table as 'كلقفظغمشسرئب^Arabic^^^'.

Please help on this.

Thanks in advance


asked 01 Apr '11, 06:41

NLBuddy's gravatar image

accept rate: 0%

edited 01 Apr '11, 12:26

Mark%20Culp's gravatar image

Mark Culp

Do you mean the 'unload' command ?

(01 Apr '11, 10:24) Daz Liquid

How are you "reading" (viewing) the text file? SQL Anywhere does not reverse the order of the characters so the order of the characters in the database will be the order of the characters when unloaded to your text file? I.e. Perhaps it is your viewer that is switching the order of the characters?

(01 Apr '11, 11:24) Mark Culp

Further to Mark's comments, Arabic data is always stored in left-to-right order in memory and on disk. That's not specific to SA -- it's always done that way. It is up to the renderer/editor/etc to draw the characters right-to-left. Rendering is covered by the Unicode "BIDI" (Bidirectional) Algorithm whose gory details are here:

When you mix Arabic and non-Arabic characters in a single string, life gets more complex and, in the absence of "higher protocols", the renderer needs to decide if it is an Arabic statement containing non-Arabic letters or vice versa. A "higher protocol" could just be as simple as a default direction setting in your viewer. Without a higher protocol, different rederers may make different choices for how to render a string. See, for example,

permanent link

answered 01 Apr '11, 14:38

John%20Smirnios's gravatar image

John Smirnios
accept rate: 37%

Sorry it is unload command, not upload.

I am new to Sybase. Here my task is migrate the Sybase DB to MS SQL Server. One of the tables contains the candidate name field which is mix of English and Arabic Characters like ‘^^^Arabic^كلقفظغمشسرئب'.

I use Unload command to export the table content to csv file, Arabic text comes first, but character are still in the same order, os it is 'كلقفظغمشسرئب^Arabic^^^'. And after importing the csv file into SQL server, the order was retained (i.e. ‘ 'كلقفظغمشسرئب^Arabic^^^'’)

I need to migrate that name field '^^^Arabic^كلقفظغمشسرئب' as it is into SQL server from Sybase 10.

Please help on this.

Thanks, NL

(05 Apr '11, 01:12) NLBuddy
Replies hidden

further to above comment,

i am usnig below command to import the csv file into SQL server. BULK INSERT TestDicomDB.dbo.TestPatient
FROM 'C:bcp_outbcp_out_unicode.csv' WITH ( BATCHSIZE = 1 ,FIELDTERMINATOR = '$$' ,DATAFILETYPE = 'widechar' ,KEEPNULLS )

(05 Apr '11, 01:14) NLBuddy

I still suggest that it very likely to be precisely the same data in both places but you are using two different viewers (GUIs, editors, etc) that have different rules on how to display the mixed Arabic and English. There is absolutely no way that SA will reorder the bytes of the string and it is highly unlikely that any software would do that. Only software that displays bidirectional text makes those choices.

(05 Apr '11, 08:46) John Smirnios
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 01 Apr '11, 06:41

question was seen: 7,577 times

last updated: 30 Dec '17, 14:45