Transact-SQL语句

来源:百度文库 编辑:神马文学网 时间:2024/07/01 14:17:14
数据定义语言
 Alter DatabaseAlter TableAlter ViewCreate DatabaseCreate Default (见注解1)Create IndexCreate Rule(见注解2)Create SchemaCreate TableCreate ViewDrop DatabaseDrop Default(见注解1)Drop IndexDrop Rule(见注解2)Drop TableDrop View 注1:在使用Create Default 创建的缺少值时,Create Table和Alter Table语句中的Default子句提供首选的ANSI标准。注2:在使用Create Rule创建的规则时,(Create Table和Alter Table语句创建的)Check 约束提供首选的ANSI标准。  数据操纵语言Begin Distributed TransactionBegin TransactionCloseCommit(见注解3)DeleteInsertReadTextRollback(见注解3)Save TransactionSelectTruncate TableUpdateUpdateTextWriteText 注3:SQL Server提供了两种Commit 和Rollback语句。Commit(不带关键字)和Rollback(不带关键字)是符合ANSI标准的语句,而Commit Transaction和Rollback Transaction则是为了提供SQL Server对嵌套事务和部分事务进行特殊支持。  编程流控制Alter FunctionAlter ProcedureAlter TriggerBegin...EndBreakContinueCreate FunctionCreate ProcedureCreate TriggerDeallocateDeclare @localvariableDeclare...CursorDrop FunctionDrop ProcedureDrop TriggerExecuteFetchFormatMessageGoToIf...ElseOpenPrintRaisErrorReturnSet @localvariableSelect @localvariableWritForWhile  权限控制 DenyGrantRevoke  备份与恢复 BackupDump(Backup的同义词,见注解4)Load(Restore的同义词,见注解4)Restore 注4:Dump 和Load语句仅仅用来提供向后的兼容性,在SQL Server的以后版本中将不再支持。  杂项Bulk InsertCheckpointCreate StatisticsDBCCDrip StatisticsGoKillReConfigureSetSetUser(见注解5)ShutDownUpdate StatisticsUpdate Statistics 注5:SetUser 语句仅仅用来提供向后的兼容性,在SQL Server的以后版本将不再支持。