Kommentar
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Enumerates a list of collations supported by the instance of SQL Server.
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
Syntax
'Declaration
Public Function EnumCollations As DataTable
'Usage
Dim instance As Server
Dim returnValue As DataTable
returnValue = instance.EnumCollations()
public DataTable EnumCollations()
public:
DataTable^ EnumCollations()
member EnumCollations : unit -> DataTable
public function EnumCollations() : DataTable
Return Value
Type: System.Data.DataTable
A DataTable object value that contains the collation information. The table describes the different columns of the returned DataTable.
Column |
Data type |
Description |
|---|---|---|
Urn |
The URN string that identifies the collation. |
|
Name |
The name of the collation. See sys.fn_helpcollations (Transact-SQL). |
|
CodePage |
The code page of the collation. See Code Page Architecture. |
|
LocaleID |
The locale of the collation. See sys.syslanguages (Transact-SQL). |
|
ComparisonStyle |
The comparison style made up of the sum of the following styles, Case insensitivity = 1, Accent insensitivity = 2, Kana type insensitivity = 64436, Width insensitivity = 131072. |
|
Description |
The description of the collation. |
Examples
C#
Server srv = new Server("(local)");
DataTable d = srv.EnumCollations();
foreach (DataRow r in d.Rows)
{
Console.WriteLine("============================================");
foreach(DataColumn c in d.Columns)
{
Console.WriteLine(c.ColumnName + " = " + r[c].ToString());
}
}
PowerShell
$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$d = new-object System.Data.Datatable
$d = $srv.EnumCollations()
Foreach ($r in $d.Rows)
{
Write-Host "============================================"
Foreach ($c in $d.Columns)
{
Write-Host $c.ColumnName "=" $r[$c]
}
}
See Also
Reference
Microsoft.SqlServer.Management.Smo Namespace