Home >> FAQs/Tutorials >> SQL Server FAQ
SQL Server FAQ - The Default Collation in a Database
(Continued from previous topic...)
How To Find Out What Is the Default Collation in a Database?
The default collation of a database comes from the server if you are not using
the COLLATE clause in the CREATE DATABASE statement. If you are not using the COLLATE clause
for character string column, it will use the default collation from the database.
Using this logic, you can find out the default collation in a database or server very easily.
See the following tutorial exercise:
CREATE DATABASE FyiCenterData
CREATE TABLE faq (Name VARCHAR(80))
Column_name ... Collation
Name ... SQL_Latin1_General_CP1_CI_AS
Now we know that the default collation for SQL Server 2005 is SQL_Latin1_General_CP1_CI_AS.
(Continued on next topic...)
- What Is a Constant or Literal?
- How To Write Character String Constants or Literals?
- What Is a Collation?
- How To Specify the Collation for a Character Data Type?
- What Happens If Strings Are Casted into Wrong Code Pages?
- How To Find Out What Is the Default Collation in a Database?
- How Fixed Length Strings Are Truncated and Padded?
- How To Enter Unicode Character String Literals?
- How To Enter Binary String Literals?
- How To Enter Date and Time Literals?
- Why I Can Not Enter 0.001 Second in Date and Time Literals?
- What Happens If Date-Only Values Are Provided as Date and Time Literals?
- What Happens If Time-Only Values Are Provided as Date and Time Literals?
- What Are Out-of-Range Errors with Date and Time Literals?
- What Happens If an Integer Is Too Big for INT Date Type?
- How Extra Digits Are Handled with NUMERIC Data Type Literals?
- How REAL and FLOAT Literal Values Are Rounded?
- What Are the Underflow and Overflow Behaviors on FLOAT Literals?