ALTER DATABASE DATABASE_NAME SET ANSI_NULL_DEFAULT ON|OFF --ANSI NULL默认值
GO
ALTER DATABASE DATABASE_NAME SET ANSI_NULLS ON|OFF --ANSI NULLS已启用
GO
ALTER DATABASE DATABASE_NAME SET ANSI_PADDING ON|OFF --ANSI填充已启用
GO
ALTER DATABASE DATABASE_NAME SET ANSI_WARNINGS ON|OFF --ANSI警告已启用
GO
ALTER DATABASE DATABASE_NAME SET ARITHABORT ON|OFF --算术中止已启用 
GO
ALTER DATABASE DATABASE_NAME SET AUTO_CLOSE ON|OFF --自动关闭
GO
ALTER DATABASE DATABASE_NAME SET AUTO_CREATE_STATISTICS ON|OFF --自动创建统计信息
GO
ALTER DATABASE DATABASE_NAME SET AUTO_SHRINK ON|OFF --自动收缩
GO
ALTER DATABASE DATABASE_NAME SET AUTO_UPDATE_STATISTICS ON|OFF --自动更新统计信息
GO
ALTER DATABASE DATABASE_NAME SET CURSOR_CLOSE_ON_COMMIT ON|OFF --提交时关闭游标功能已启用
GO
ALTER DATABASE DATABASE_NAME SET CURSOR_DEFAULT  GLOBAL|LOCAL --默认游标
GO
ALTER DATABASE DATABASE_NAME SET CONCAT_NULL_YIELDS_NULL ON|OFF --串联的NULL结果为NULL
GO
ALTER DATABASE DATABASE_NAME SET NUMERIC_ROUNDABORT ON|OFF --数值舍入中止
GO
ALTER DATABASE DATABASE_NAME SET QUOTED_IDENTIFIER ON|OFF --允许带引号的标识符
GO
ALTER DATABASE DATABASE_NAME SET RECURSIVE_TRIGGERS ON|OFF --递归触发器已启用
GO
ALTER DATABASE DATABASE_NAME SET ENABLE_BROKER|DISABLE_BROKER --数据库启动|禁用 Service Broker
GO
ALTER DATABASE DATABASE_NAME SET AUTO_UPDATE_STATISTICS_ASYNC ON|OFF --自动异步更新统计信息
GO
ALTER DATABASE DATABASE_NAME SET DATE_CORRELATION_OPTIMIZATION ON|OFF --日期相关性优化已启动
GO
ALTER DATABASE DATABASE_NAME SET TRUSTWORTHY ON|OFF --可信
GO
ALTER DATABASE DATABASE_NAME SET ALLOW_SNAPSHOT_ISOLATION ON|OFF --事务可以指定 SNAPSHOT 事务隔离级别
GO
ALTER DATABASE DATABASE_NAME SET PARAMETERIZATION SIMPLE|FORCED  --参数化
GO
ALTER DATABASE DATABASE_NAME SET  READ_WRITE|READ_ONLY --数据库为只读
GO
ALTER DATABASE DATABASE_NAME SET RECOVERY FULL|BULK_LPGGED|SIMPLE --恢复模式
GO
ALTER DATABASE DATABASE_NAME SET  MULTI_USER|SINGLE_USER|RESTRICTED_USER --限制访问
GO
ALTER DATABASE DATABASE_NAME SET PAGE_VERIFY CHECKSUM|TORNPAGEDETECTION  --页验证
GO
ALTER DATABASE DATABASE_NAME SET DB_CHAINING ON|OFF --跨数据库所有权链接已启用

 

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
版权声明:本文为博主原创文章,转载请附上博文链接!

posted on 2019-01-03 11:17  qqhfeng16  阅读(416)  评论(0编辑  收藏  举报