WEB开发网
开发学院数据库MSSQL Server SQL Server的Collate语句需注意 阅读

SQL Server的Collate语句需注意

 2007-05-19 09:40:58 来源:WEB开发网   
核心提示: Windows_collation_name Is the collation name for Windows collation. See Windows Collation Names. SQL_collation_name Is the collation name for a S

Windows_collation_name

Is the collation name for Windows collation. See Windows Collation Names.

SQL_collation_name

Is the collation name for a SQL collation. See SQL Collation Names.

Remarks

The COLLATE clause can be specified at several levels, including the following:

Creating or altering a database.

You can use the COLLATE clause of the CREATE DATABASE or ALTER DATABASE statement to specify the default collation of the database. You can also specify a collation when you create a database using SQL Server Enterprise Manager. If you do not specify a collation, the database is assigned the default collation of the SQL Server instance.

Creating or altering a table column.

You can specify collations for each character string column using the COLLATE clause of the CREATE TABLE or ALTER TABLE statement. You can also specify a collation when you create a table using SQL Server Enterprise Manager. If you do not specify a collation, the column is assigned the default collation of the database.

You can also use the database_default option in the COLLATE clause to specify that a column in a temporary table use the collation default of the current user database for the connection instead of tempdb.

Casting the collation of an expression.

You can use the COLLATE clause to cast a character expression to a certain collation. Character literals and variables are assigned the default collation of the current database. Column references are assigned the definition collation of the column. For the collation of an expression, see Collation Precedence.

上一页  1 2 3 4  下一页

Tags:SQL Server Collate

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接