Unicode

  • How do you set up a database so that it defaults to Unicode?

    Thank you

  • You create your table columns with NChar, Nvarchar, Nvarchar(max) and NText in SQL Server 2000. In some langauges you also need the code page used for that language with the collation.

    Kind regards,
    Gift Peddie

  • In SQL Server 2K5 it is enabled by default. Just keep in mind the storage gets doubled, so a single character takes up two bytes.

  • In SQL Server 2K5 it is enabled by default. Just keep in mind the storage gets doubled, so a single character takes up two bytes.

    I am not sure what you mean by enabled by default because you have to option to use Varchar or Char which even in 2005 will not give you Unicode.

    Kind regards,
    Gift Peddie

  • Sorry, unlike Oracle, besides for using a unicode datatype you don't have to do anything to be able to use Unicode in SQL Server

  • SQL Server got that in 2000 because in SQL Server 7.0 Unicode require reinstall, and you are right 2005 comes with more easy to use Unicode.

    Kind regards,
    Gift Peddie

  • sorry for not being clear. Here is my puzzle, I have two 2005 databases in two different instances. In one database if I right click and select New Table, Fill in the Column Name,then move to the Data type it will fill in with a "nchar", if I do the same thing on the other database it fills in with a "char"

    Is there a default setting somewhere that says, if new table make it "nchar"?

    Thank you

  • No but Nchar and Nvarchar are in the data type drop down list you can choose it, however you could choose a collation that uses only Unicode in your database options in properties.

    Kind regards,
    Gift Peddie

  • Both databases are set to SQL_Latin1_General_CP1_Cl_AS. So it must be remembering last created or something.

    Thank you.

  • The short answer is no because that collation is US English so if you need unicode you have to define the columns as Nvarchar Nchar, Ntext and Nvarchar(max). Check below for all the defined collations.

    http://msdn.microsoft.com/en-us/library/ms143508.aspx

    http://msdn.microsoft.com/en-us/library/ms144250.aspx

    Kind regards,
    Gift Peddie

  • Thank you, that was helpfull.

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply