Is there a windows unicode-only collation? - sql-server

I am trying to get my head around Unicode and Collations and how to use collations properly in ms sql server 2014.
Microsoft states:
"Windows Unicode-only collations can only be used with the COLLATE clause to apply collations to the nchar, nvarchar, and ntext data types on column level and expression-level data. They cannot be used with the COLLATE clause to change the collation of a database or server instance."
What Windows unicode-only collations are? I want to convert my database to support unicode so now I use only nvarchar, nchar and ntext. I did SELECT * FROM sys.fn_helpcollations() and I got a list of collations. None of them is described as Unicode-only collation. That's where I am getting confused, if there is a unicode only collation as microsoft states how can I find it and what's the logic behind it?

use this to get collations with codepage is 0, should be the unicode-only collations.
select name, COLLATIONPROPERTY(name, 'CodePage') as CodePage, description
from sys.fn_HelpCollations() order by code_page
go

Related

SQL Server 2016 UTF-8 support of nvarchar columns?

I'm trying to figure out if my SQL Database setup is ready to store any language in the world (also Japanese). Having read a lot of documentation (Microsofts own) I'm still unsure if further specification of collation is needed.
Database: SQL Server Standard 2016
Collation: SQL_Latin1_General_CP1_CI_AS
Question: I have a table with a MovieTitle column, defined as nvarchar(2048). Will this be able to store the movie title of any language in the world? According to the documentation it seems that any nvarchar column is UTF-8 from SQL Server version 2009.
I'm asking because recently I searched for
WHERE MovieTitle = ''
and it returns several results with different Arabic titles.

SQL Server 2008 r2: vietnamese letters are not stored correctly

The problem is the following: I have a column of type nvarchar, collation is set to Vietnamese_CI_AS. I insert some data containing vietnamese letters (using MS SQL Server Management studio). And then it is not displayed correctly in SQL Server Management studio and application.
Data:
Result
Any suggestions?
You must always declare N before inserting any values. N stands for national language character set.
Have a look at this post to get a better understanding.
What is the difference between varchar and nvarchar?

nvarchar & varchar with Oracle & SQLServer

I need to upload some data from an Oracle table to a SQL Server table. The data will be uploaded to the SQL server using a Java processing utilising JDBC facilities.
Is there any benefit in creating the SQL server columns using nvarchar instead of varchar?
Google suggests that nvarchar is used when UNICODE characters are involved but i am wondering does nvarchar provide any benefit in this situation? (i.e. when the source data of the SQL Server table comes from an Oracle database running a Unix environment?)
Thanks in advance
As you have found out, nvarchar stores unicode characters - the same as nvarchar2 within Oracle. It comes down to whether your source data is unicode - or whether you anticipate having to store unicode values in future (e.g. internationalized software)

SQL Server 2008 Case Sensitivity problem

My SQL Server query analyzer raises an error when I type my table names with lower-case letters.
My server and database collations are SQL_Latin1_General_CP1254_CI_AS.
Despite of it, Select * from table raises an error, while Select * From TABLE doesn't raise any error.
Where I am wrong? How can I make case-insensitive? I use SQL Server 2008
Give "select * from [table]" a try. And this is a silly question but is the name of the table, table?
Your server has a case insensitive collation, but each individual database may have its own collation. As it happens, this particular database has a case sensitive collation. If not explicitly specified (see CREATE DATABASE ... COLLATE ...) databases inherit the collation of the server they were originally created on. Likely this database was created on a server that had case sensitive collation and then attached/restored on your server.
the current database collation can be seen, for each database, in sys.databases:
select collation_name
from sys.databases
where database_id = db_id('...');

Does Access have any issues with unicode capable data types like nvarchar in SQL Server?

I am using Access 2003 as a front end UI for a SQL Server 2008 database. In looking at my SQL Server database design I am wondering if nvarchar was the right choice to use over varchar. I chose nvarchar because I thought it would be useful in case any characters represented by unicode needed to be entered. However, I didn't think about any possible issues with Access 2003 using the uni-code datatype. Are there any issues with Access 2003 working with unicode datatypes within SQL Server (i.e. nvarchar)? Thank you.
You can go ahead and use nvarchar, if that's the correct datatype for the job. Access supports Unicode data, both with it's own tables and with external (linked) tables and direct queries.

Resources