Подія
31 бер., 23 - 2 квіт., 23
Найбільший навчальний захід SQL, Fabric і Power BI. 31 березня – 2 квітня. Щоб заощадити 400 грн, скористайтеся кодом FABINSIDER.
Реєструйтеся сьогодніЦей браузер більше не підтримується.
Замініть його на Microsoft Edge, щоб користуватися перевагами найновіших функцій, оновлень безпеки та технічної підтримки.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
You can view the collation of a server, database, or column in SQL Server Management Studio using Object Explorer menu options or by using Transact-SQL.
You can use one of the following:
To view a collation setting for a server (instance of SQL Server) in Object Explorer
In Object Explorer, connect to an instance of Database Engine.
Right-click the instance and select Properties.
To view a collation setting for a database in Object Explorer
In Object Explorer, connect to an instance of Database Engine and then expand that instance.
Expand Databases, right-click the database and select Properties.
To view a collation setting for a column in Object Explorer
In Object Explorer, connect to an instance of Database Engine and then expand that instance.
Expand Databases, expand the database and then expand Tables.
Expand the table that contains the column and then expand Columns.
Right-click the column and select Properties. If the collation property is empty, the column is not a character data type.
To view the collation setting of a server
In Object Explorer, connect to an instance of the Database Engine and on the toolbar, click New Query.
In the query window, enter the following statement that uses the SERVERPROPERTY system function.
SELECT CONVERT (varchar(256), SERVERPROPERTY('collation'));
Alternatively, you can use the sp_helpsort system stored procedure.
EXECUTE sp_helpsort;
To view all collations supported by SQL Server
In Object Explorer, connect to an instance of the Database Engine and on the toolbar, click New Query.
In the query window, enter the following statement that uses the SERVERPROPERTY system function.
SELECT name, description FROM sys.fn_helpcollations();
To view the collation setting of a database
In Object Explorer, connect to an instance of the Database Engine and on the toolbar, click New Query.
In the query window, enter the following statement that uses the sys.databases system catalog view.
SELECT name, collation_name FROM sys.databases;
Alternatively, you can use the DATABASEPROPERTYEX system function.
SELECT CONVERT (varchar(256), DATABASEPROPERTYEX('database_name','collation'));
To view the collation setting of a column
In Object Explorer, connect to an instance of the Database Engine and on the toolbar, click New Query.
In the query window, enter the following statement that uses the sys.columns system catalog view.
SELECT name, collation_name FROM sys.columns WHERE name = N'<insert character data type column name>';
To view the collation settings for tables and columns
In Object Explorer, connect to an instance of the Database Engine and on the toolbar, click New Query.
In the query window, enter the following statement that uses the sys.columns system catalog view.
SELECT t.name TableName, c.name ColumnName, collation_name
FROM sys.columns c
inner join sys.tables t on c.object_id = t.object_id;
SERVERPROPERTY (Transact-SQL)
sys.fn_helpcollations (Transact-SQL)
sys.databases (Transact-SQL)
sys.columns (Transact-SQL)
Collation Precedence (Transact-SQL)
Collation and Unicode Support
sp_helpsort (Transact-SQL)
Подія
31 бер., 23 - 2 квіт., 23
Найбільший навчальний захід SQL, Fabric і Power BI. 31 березня – 2 квітня. Щоб заощадити 400 грн, скористайтеся кодом FABINSIDER.
Реєструйтеся сьогодніНавчання
Сертифікація
Microsoft Certified: Azure Database Administrator Associate - Certifications
Адмініструйте інфраструктуру баз даних SQL Server для хмарних, локальних і гібридних реляційних баз даних за допомогою пропозицій реляційних баз даних Microsoft PaaS.
Документація
Set or Change the Column Collation - SQL Server
Set or Change the Column Collation
Collation and Unicode Support - SQL Server
Learn about collation and Unicode support in SQL Server.
Set or change the database collation - SQL Server
Set or change the database collation