Page 1 of 1

WideString UniDAC - SQL Server

Posted: Tue 05 May 2015 10:55
by krshin
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...

Re: WideString UniDAC - SQL Server

Posted: Tue 05 May 2015 23:19
by FredS
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..

Re: WideString UniDAC - SQL Server

Posted: Fri 08 May 2015 12:45
by azyk
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

Re: WideString UniDAC - SQL Server

Posted: Mon 11 May 2015 13:40
by krshin
Thaks to all, it is a solution for my problem.

:D

Re: WideString UniDAC - SQL Server

Posted: Tue 12 May 2015 13:42
by azyk
If any other questions come up, please contact us.