Exemplo n.º 1
0
 internal void Initialize(Interop.ITable dmoTable)
 {
     base.SetName(dmoTable.GetName());
     base.SetCreationDate(DateTime.Parse(dmoTable.GetCreateDate()));
     base.SetLastModifiedDate(DateTime.MinValue);
 }
Exemplo n.º 2
0
 internal void Initialize(Interop.IStoredProcedure dmoSproc)
 {
     base.SetName(dmoSproc.GetName());
     base.SetCommandText(dmoSproc.GetText());
     base.SetCreationDate(DateTime.Parse(dmoSproc.GetCreateDate()));
 }
Exemplo n.º 3
0
 internal void Initialize(Interop.IColumn dmoColumn)
 {
     this.Name = dmoColumn.GetName();
     this.DataType = dmoColumn.GetPhysicalDatatype();
     SqlDataType sqlDataType = GetSqlDataType(this.DataType);
     this.AllowNulls = dmoColumn.GetAllowNulls();
     string text = dmoColumn.GetDRIDefault().GetText();
     if (((text != null) && text.StartsWith("(")) && text.EndsWith(")"))
     {
         this.DefaultValue = text.Substring(1, text.Length - 2);
     }
     else
     {
         this.DefaultValue = text;
     }
     if (SupportsRowGuid(sqlDataType))
     {
         this.IsRowGuid = dmoColumn.GetIsRowGuidCol();
     }
     if (SupportsNumericPrecision(sqlDataType))
     {
         this.NumericPrecision = dmoColumn.GetNumericPrecision();
     }
     if (SupportsNumericScale(sqlDataType))
     {
         this.NumericScale = dmoColumn.GetNumericScale();
     }
     if (SupportsSize(sqlDataType))
     {
         this.Size = dmoColumn.GetLength();
     }
     if (SupportsIdentity(sqlDataType, this.NumericScale))
     {
         this.IsIdentity = dmoColumn.GetIdentity();
         if (this.IsIdentity)
         {
             this.IdentityIncrement = dmoColumn.GetIdentityIncrement();
             this.IdentitySeed = dmoColumn.GetIdentitySeed();
         }
     }
     this.InPrimaryKey = dmoColumn.GetInPrimaryKey();
     foreach (Microsoft.Matrix.Packages.DBAdmin.DBEngine.Key key in base.Table.Keys)
     {
         if (((key.KeyType == KeyType.Unique) && (key.ReferencedColumns.Count == 1)) && (key.ReferencedColumns.GetValues(this.Name) != null))
         {
             this.IsUniqueKey = true;
         }
     }
 }