Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4018412
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:58:47+00:00 2026-05-20T09:58:47+00:00

Is there any way in SQL Server of determining what a character in a

  • 0

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?

Example. If I create a test database with collation SQL_Ukrainian_CP1251_CS_AS and then do CHAR(255) it returns я.

If I try the following on a database with SQL_Latin1_General_CP1_CS_AS collation however

SELECT CHAR(255) COLLATE SQL_Ukrainian_CP1251_CS_AS

It returns y

SELECT CHAR(255)

Returns ÿ 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:58:48+00:00Added an answer on May 20, 2026 at 9:58 am

    While MS SQL supports both code pages and Unicode unhelpfully it doesn’t provide any functions to convert between the two so figuring out what character is represented by a value in a different code page is a pig.

    There are two potential methods I’ve seen to handle conversions, one is detailed here
    http://www.codeguru.com/cpp/data/data-misc/values/article.php/c4571
    and involves bolting a custom conversion program onto the database and using that for conversions.

    The other is to construct a db table consisting of

    [CodePage], [ANSI Value], [UnicodeValue]
    

    with the unicode value stored as either the int representing the unicode character to be converted using nchar()or the nchar itself

    Your using the collation SQL_Ukrainian_CP1251_CS_AS which is code page 1251 (CP1251 from the centre of the string). You can grab its translation table here http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT

    Its a TSV so after trimming the top off the raw data should import fairly cleanly.

    Personally I’d lean more towards the latter than the former especially for a production server as the former may introduce instability.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to password protect an SQL server database without using commercial
Is there any way that without installing SQL Server on a machine, a .NET
Is there any way in SQL Server to get the results starting at a
Is there any way to add a SQL Server Database Diagram to source control?
Is there any way to debug a SQL Server 2008 query?
Is there any way to pre compile stored procedures in SQL Server? My requirement
Is there any way to use inheritance in database (Specifically in SQL Server 2005)?
In SQL Server, is there any way to check whether the changes in the
Is there any way to use SQL Server as physical message transport instead of
Is there any way of retreaving a SQL Server Authenticatiion password. I am running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.