用法很简单 db.DbMaintenance.方法名(参数)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #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