March 6, 2009 at 3:10 pm
How do you set up a database so that it defaults to Unicode?
Thank you
March 6, 2009 at 4:13 pm
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
March 9, 2009 at 7:34 am
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.
March 9, 2009 at 7:40 am
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
March 9, 2009 at 7:43 am
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
March 9, 2009 at 8:00 am
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
March 9, 2009 at 2:27 pm
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
March 9, 2009 at 2:39 pm
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
March 10, 2009 at 7:59 am
Both databases are set to SQL_Latin1_General_CP1_Cl_AS. So it must be remembering last created or something.
Thank you.
March 10, 2009 at 8:19 am
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
March 13, 2009 at 7:59 am
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