MS SQL Server Concepts and Programming Question:
Download Questions PDF

How To Specify the Collation for a Character Data Type in MS SQL Server?

Answer:

If you do not want to use the default collation provided by the SQL Server, you can use the "COLLATE collation_name" clause to specify a different collation to be used at different levels:

* Database Level - Used in CREATE DATABASE or ALTER DATABASE statements to set a new default collation for the entire database.
* Table Column Level - Used in CREATE TABLE or ALTER TABLE statements to override the database default collation for this column.
* Character String Expression Level - Used at the end of the expression to cast the expression to the specified collation.


Download MS SQL Server Interview Questions And Answers PDF

Previous QuestionNext Question
What Is a Collation in MS SQL Server?What Happens If Strings Are Casted into Wrong Code Pages in MS SQL Server?