ColumnDA: Get columns collation.
This commit is contained in:
@@ -126,6 +126,16 @@ namespace VAR.DatabaseExplorer.Code.BusinessLogic
|
||||
{
|
||||
txtWriter.Write(c.Type);
|
||||
}
|
||||
if (string.IsNullOrEmpty(c.Colation) == false && (
|
||||
c.Type == "nvarchar" ||
|
||||
c.Type == "varchar" ||
|
||||
c.Type == "char" ||
|
||||
c.Type == "nchar" ||
|
||||
false
|
||||
))
|
||||
{
|
||||
txtWriter.Write(string.Format(" COLLATE {0}", c.Colation));
|
||||
}
|
||||
if (c.Nullable)
|
||||
{
|
||||
txtWriter.Write(" NULL");
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace VAR.DatabaseExplorer.Code.DataAccess
|
||||
c.KeyType AS KeyType,
|
||||
col.IS_NULLABLE AS Nullable,
|
||||
CASE WHEN (COLUMNPROPERTY(object_id(col.TABLE_SCHEMA+'.'+col.TABLE_NAME), col.COLUMN_NAME, 'IsIdentity') = 1) THEN 1 ELSE 0 END IsIdentity,
|
||||
col.COLLATION_NAME Colation,
|
||||
NULL EmptyColumn
|
||||
FROM INFORMATION_SCHEMA.COLUMNS AS col
|
||||
LEFT JOIN (
|
||||
@@ -81,6 +82,7 @@ namespace VAR.DatabaseExplorer.Code.DataAccess
|
||||
col.PK = true;
|
||||
}
|
||||
col.Indentity = Convert.ToBoolean(dr["IsIdentity"]);
|
||||
col.Colation = Convert.ToString(dr["Colation"]);
|
||||
|
||||
columns.Add(col);
|
||||
}
|
||||
|
||||
@@ -29,5 +29,8 @@ namespace VAR.DatabaseExplorer.Code.DataTransfer
|
||||
|
||||
[XmlAttribute]
|
||||
public bool Indentity { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public string Colation { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user