Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, the problem is most likely the collation. The <code>Latin1_General</code> collation does not include the rules to sort and compare non latin characters.</p> <p>MSDN claims:</p> <blockquote> <p>If you must store character data that reflects multiple languages, you can minimize collation compatibility issues by always using the Unicode nchar, nvarchar, and ntext data types instead of the char, varchar, text data types. Using the Unicode data types eliminates code page conversion issues.</p> </blockquote> <p>Since you have already complied with this, you should read further on the info about Mixed Collation Environments <a href="http://msdn.microsoft.com/en-us/library/aa214897(SQL.80).aspx" rel="nofollow noreferrer"><strong>here</strong></a>.</p> <p>Additionally I want to add that just changing a collation is not something done easy, check the MSDN for SQL 2000:</p> <blockquote> <p>When you set up SQL Server 2000, it is important to use the correct collation settings. You can change collation settings after running Setup, but you must rebuild the databases and reload the data. It is recommended that you develop a standard within your organization for these options. Many server-to-server activities can fail if the collation settings are not consistent across servers.</p> </blockquote> <p>You can specify a collation on a per column bases however:</p> <pre><code>CREATE TABLE TestTable ( id int, GreekColCaseInsensitive nvarchar(10) collate greek_ci_as, LatinColCaseSensitive nvarchar(10) collate latin1_general_cs_as ) </code></pre> <p>Have a look at the different binary multilingual collations <a href="http://msdn.microsoft.com/en-us/library/aa176552(SQL.80).aspx" rel="nofollow noreferrer"><strong>here</strong></a>. Depending on the charset you use, you should find one that fits your purpose.</p> <p>If you are not able or willing to change the collation of a column you can also just specify the collation to be used in the query like:</p> <pre><code>SELECT * From TestTable WHERE GreekColCaseInsensitive = N'test - ۓےۑ' COLLATE latin1_general_cs_as </code></pre> <p>As <strong><a href="https://stackoverflow.com/users/70424/jfrobishow">jfrobishow</a></strong> pointed out the use of <strong>N</strong> in front of the string you want to use to compare is essential. What does it do:</p> <blockquote> <p>It denotes that the subsequent string is in Unicode (the N actually stands for National language character set). Which means that you are passing an NCHAR, NVARCHAR or NTEXT value, as opposed to CHAR, VARCHAR or TEXT. See Article #2354 for a comparison of these data types.</p> </blockquote> <p>You can find a quick rundown <a href="http://databases.aspfaq.com/general/why-do-some-sql-strings-have-an-n-prefix.html" rel="nofollow noreferrer"><strong>here</strong></a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload