WideString UniDAC - SQL Server

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
krshin
Posts: 14
Joined: Wed 21 Mar 2007 11:29

WideString UniDAC - SQL Server

Post by krshin » Tue 05 May 2015 10:55

Hello Devart,

I have one small problem (or situation) with SQL Server connected with UniDAC but this app must connect to Firebird and MySQL too to same DataModel.
Firebird database is 2.5 UTF8 Collation, MySQL database UTF8 Collation and SQL Server Latin_CI and I need to insert latin and cyrilic characters in some fields but in Firebird and MySQL fields are ftWideString and in SQL Server are String and doesn't accept Cyrilic characters what do I need to do and how to cofigure SQL Server Collation to work same as Firebird and MySQL database?

Thanks in advance for help...

FredS
Posts: 272
Joined: Mon 10 Nov 2014 17:52

Re: WideString UniDAC - SQL Server

Post by FredS » Tue 05 May 2015 23:19

I had to re-create all varchar as nvarchar to make SQLServer Unicode.

In your metadata script replace (varchar with nvarchar) and re-create your db.
But the collation is Server dependent from what I remember.

Unicode (UTF8) will accept all characters but collation deals with sorting, indexing and SQL results. So Latin_CI may not return the correct results..

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: WideString UniDAC - SQL Server

Post by azyk » Fri 08 May 2015 12:45

The solution suggested by FredS is correct. SQL Server supports UTF encoding for nchar/nvarchar/ntext data types.

See how to change SQL Server Collation (e.g., from Latin_CI to Cyrillic) in the SQL Server documentation: https://msdn.microsoft.com/en-us/library/ms175835.aspx

krshin
Posts: 14
Joined: Wed 21 Mar 2007 11:29

Re: WideString UniDAC - SQL Server

Post by krshin » Mon 11 May 2015 13:40

Thaks to all, it is a solution for my problem.

:D

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: WideString UniDAC - SQL Server

Post by azyk » Tue 12 May 2015 13:42

If any other questions come up, please contact us.

Post Reply