ALTER DATABASE database_name
{ <add_or_modify_files> | <add_or_modify_filegroups> | <set_database_options> | MODIFY NAME = new_database_name | COLLATE collation_name } [;] <add_or_modify_files>::= { ADD FILE <filespec> [ ,...n ] [ TO FILEGROUP { filegroup_name } ] | ADD LOG FILE <filespec> [ ,...n ] | REMOVE FILE logical_file_name | MODIFY FILE <filespec>} <filespec>::= ( NAME = logical_file_name [ , NEWNAME = new_logical_name ] [ , FILENAME = 'os_file_name' ] [ , SIZE = size [ KB | MB | GB | TB ] ] [ , MAXSIZE = { max_size [ KB | MB | GB | TB ] | UNLIMITED } ] [ , FILEGROWTH = growth_increment [ KB | MB | GB | TB| % ] ] [ , OFFLINE ] ) <add_or_modify_filegroups>::= { | ADD FILEGROUP filegroup_name | REMOVE FILEGROUP filegroup_name | MODIFY FILEGROUP filegroup_name { <filegroup_updatability_option> | DEFAULT | NAME = new_filegroup_name } } <filegroup_updatability_option>::= { { READONLY | READWRITE } | { READ_ONLY | READ_WRITE } } <set_database_options>::=SET { { <optionspec> [ ,...n ] [ WITH <termination> ] } } <optionspec>::= { <db_state_option> | <db_user_access_option> | <db_update_option> | <external_access_option> | <cursor_option> | <auto_option> | <sql_option> | <recovery_option> | <database_mirroring_option> | <service_broker_option> | <date_correlation_optimization_option> | <parameterization_option> }<db_state_option> ::= { ONLINE | OFFLINE | EMERGENCY } <db_user_access_option> ::= { SINGLE_USER | RESTRICTED_USER | MULTI_USER } <db_update_option> ::= { READ_ONLY | READ_WRITE } <external_access_option> ::= { DB_CHAINING { ON | OFF } | TRUSTWORTHY { ON | OFF } } <cursor_option> ::= { CURSOR_CLOSE_ON_COMMIT { ON | OFF } | CURSOR_DEFAULT { LOCAL | GLOBAL } } <auto_option> ::= { AUTO_CLOSE { ON | OFF } | AUTO_CREATE_STATISTICS { ON | OFF } | AUTO_SHRINK { ON | OFF } | AUTO_UPDATE_STATISTICS { ON | OFF } | AUTO_UPDATE_STATISTICS_ASYNC { ON | OFF } } <sql_option> ::= { ANSI_NULL_DEFAULT { ON | OFF } | ANSI_NULLS { ON | OFF } | ANSI_PADDING { ON | OFF } | ANSI_WARNINGS { ON | OFF } | ARITHABORT { ON | OFF } | CONCAT_NULL_YIELDS_NULL { ON | OFF } | NUMERIC_ROUNDABORT { ON | OFF } | QUOTED_IDENTIFIER { ON | OFF } | RECURSIVE_TRIGGERS { ON | OFF } }<recovery_option> ::= { RECOVERY { FULL | BULK_LOGGED | SIMPLE } | TORN_PAGE_DETECTION { ON | OFF } | PAGE_VERIFY { CHECKSUM | TORN_PAGE_DETECTION | NONE } } <database_mirroring_option> ::= { <partner_option> | <witness_option> } <partner_option> ::= PARTNER { = 'partner_server' | FAILOVER | FORCE_SERVICE_ALLOW_DATA_LOSS | OFF | RESUME | SAFETY { FULL | OFF } | SUSPEND | TIMEOUT integer } <witness_option> ::= WITNESS { = 'witness_server' | OFF } <service_broker_option> ::= {ENABLE_BROKER | DISABLE_BROKER | NEW_BROKER | ERROR_BROKER_CONVERSATIONS } <date_correlation_optimization_option> ::= { DATE_CORRELATION_OPTIMIZATION { ON | OFF } } <parameterization_option> ::= { PARAMETERIZATION { SIMPLE | FORCED } } <snapshot_option> ::= { ALLOW_SNAPSHOT_ISOLATION {ON | OFF } | READ_COMMITTED_SNAPSHOT {ON | OFF } }<termination> ::= { ROLLBACK AFTER integer [ SECONDS ] | ROLLBACK IMMEDIATE | NO_WAIT }--------------------- 作者:usher_gml 来源:CSDN 原文:https://blog.csdn.net/usher_gml/article/details/4357145 版权声明:本文为博主原创文章,转载请附上博文链接!