In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what are the basic transaction commands of commonly used relational databases". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the basic transaction commands of a commonly used relational database.
Introduction to basic transaction commands
Description: in command
| (vertical bar) separate syntax items in parentheses or curly braces. Only one of them can be used.
[] (square brackets) optional grammar items. Do not type square brackets.
{} (curly braces) required grammar items. Do not type curly braces.
SQLSERVER
1) BEGIN {TRAN | TRANSACTION} [{transaction_name | @ tran_name_variable} [WITHMARK ['description']] [;]
Indicates that a local transaction with a value named transaction_name or @ tran_name_variable is explicitly opened.
2) BEGINDISTRIBUTED {TRAN | TRANSACTION} [transaction_name | @ tran_name_variable] [;]
Means to explicitly open a distributed transaction with a value named transaction_name or @ tran_name_variable
3) COMMIT [{TRAN | TRANSACTION} [transaction_name | @ tran_name_variable]] [WITH (DELAYED_DURABILITY= {OFF | ON})] [;]
Indicates that the transaction is committed and the transaction is released to use resources, and all data changes since the beginning of the transaction become a permanent part of the database. The contents in square brackets can be omitted, so the commit of COMMIT transactions is the same as COMMITTRANSACTION.
4) COMMIT [WORK] [;]
Commit and end the transaction. The same functionality as COMMITTRANSACTION, but COMMITTRANSACTION accepts the specified transaction name. This syntax is compatible with SQL-92.
5) ROLLBACK {TRAN | TRANSACTION} [transaction_name | @ tran_name_variable | savepoint_name | @ savepoint_variable] [;]
Means to roll back the transaction to the starting point or specify a SavePoint to clear all data changes from the starting point of the transaction to a SavePoint and release related resources. The contents in square brackets can be omitted, and the rollback of ROLLBACK transactions has the same function as ROLLBACKTRANSACTION.
6) ROLLBACK [WORK] [;]
Roll back the transaction to the starting point of the transaction. The same functionality as ROLLBACKTRANSACTION, but ROLLBACKTRANSACTION can specify a transaction name. This ROLLBACK is compliant with the ISO standard.
When nesting transactions, ROLLBACKWORK always rolls back to the farthest BEGINTRANSACTION statement and reduces the @ @ TRANCOUNT system function to 0
7) SAVE {TRAN | TRANSACTION} {savepoint_name | @ savepoint_variable} [;]
Set the transaction save point within the transaction. Savepoint_name is the name assigned to the SavePoint. Savepoint_variable is the name of a user-defined variable that contains a valid save point name.
8) SETTRANSACTIONISOLATIONLEVEL {READUNCOMMITTED | READCOMMITTED | REPEATABLEREAD | SNAPSHOT | SERIALIZABLE}
At this point, I believe you have a deeper understanding of "what are the basic transaction commands of a commonly used relational database". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.