用法很简单 db.DbMaintenance.方法名(参数)
#region DML List<DbTableInfo> GetViewInfoList(); List<DbTableInfo> GetTableInfoList(); List<DbColumnInfo> GetColumnInfosByTableName(string tableName); List<string> GetIsIdentities(string tableName); List<string> GetPrimaries(string tableName); #endregion #region Check bool IsAnyTable(string tableName); bool IsAnyColumn(string tableName, string column); bool IsPrimaryKey(string tableName, string column); bool IsIdentity(string tableName, string column); bool IsAnyConstraint(string ConstraintName); #endregion #region DDL bool DropTable(string tableName); bool TruncateTable(string tableName); bool CreateTable(string tableName, List<DbColumnInfo> columns); bool AddColumn(string tableName, DbColumnInfo column); bool UpdateColumn(string tableName, DbColumnInfo column); bool AddPrimaryKey(string tableName,string columnName); bool DropConstraint(string tableName, string constraintName); bool BackupDataBase(string databaseName,string fullFileName); bool BackupTable(string oldTableName, string newTableName, int maxBackupDataRows = int.MaxValue); bool DropColumn(string tableName,string columnName); bool RenameColumn(string tableName, string oldColumnName, string newColumnName); #endregion
2016 © donet5.comApache Licence 2.0