title: SQL Server Code Pages and Collations
body: <p>Is there any way in SQL Server of determining what a character in a code page would represent without actually creating a test database of that collation?</p>
  
  <p>Example. If I create a test database with collation <code>SQL_Ukrainian_CP1251_CS_AS</code> and then do <code>CHAR(255)</code> it returns <code>я</code>.</p>
  
  <p>If I try the following on a database with <code>SQL_Latin1_General_CP1_CS_AS</code> collation however</p>
  
  <pre><code>SELECT CHAR(255) COLLATE SQL_Ukrainian_CP1251_CS_AS
  </code></pre>
  
  <p>It returns <code>y</code></p>
  
  <pre><code>SELECT CHAR(255)
  </code></pre>
  
  <p>Returns <code>ÿ</code> so it is obviously going first via the database's default collation then trying to find the closest equivalent to that in the explicit collation. Can this be avoided?</p>