Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

OMS now shows table and index column types in treeview

  • Loading branch information...
commit 7eb2d4db678a1b7a20b8c826aaced47c6d7997e0 1 parent 988cc24
@improvedk authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/OrcaMDF.OMS/Main.cs
View
14 src/OrcaMDF.OMS/Main.cs
@@ -176,7 +176,12 @@ private void addTablesNode(TreeNode rootNode)
.OrderBy(c => c.Name);
foreach (var c in columns)
- tableColumnsNode.Nodes.Add(c.Name);
+ {
+ var mainColumn = db.Dmvs.Columns.Where(x => x.ColumnID == c.ColumnID && x.ObjectID == c.ObjectID).Single();
+ var type = db.Dmvs.Types.Where(x => x.SystemTypeID == mainColumn.SystemTypeID).First();
+
+ tableColumnsNode.Nodes.Add(c.Name + " (" + type.Name + "[" + type.MaxLength + "])");
+ }
// Add indexes
var tableIndexesNode = tableNode.Nodes.Add("Indexes");
@@ -193,7 +198,12 @@ private void addTablesNode(TreeNode rootNode)
.Where(ic => ic.ObjectID == t.ObjectID && ic.IndexID == i.IndexID);
foreach (var ic in indexColumns)
- indexNode.Nodes.Add(columns.Where(c => c.ColumnID == ic.ColumnID).Single().Name);
+ {
+ var mainColumn = db.Dmvs.Columns.Where(x => x.ColumnID == ic.ColumnID && x.ObjectID == ic.ObjectID).Single();
+ var type = db.Dmvs.Types.Where(x => x.SystemTypeID == mainColumn.SystemTypeID).First();
+
+ indexNode.Nodes.Add(columns.Where(c => c.ColumnID == ic.ColumnID).Single().Name + " (" + type.Name + "[" + type.MaxLength + "])");
+ }
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.