A transaction is a mechanism and an operation sequence. It contains a group of database operation commands. All the commands will be used as a whole, and they will be submitted or revoked together to the system. The requests will either be executed
We generally think that truncate is an operation that cannot be rolled back, it deletes all the data in the table and resets the identity column.
If you do a truncate operation in a transaction, you can roll back. Conversely, it does not recover
In developing Web applications, we often need to process drives, folders, and files in a file system, such as collecting information about drives, creating, adding, moving, or deleting folders and files. A new set of the FSO (File system object)
ASP tutorials. NET and SQL processing1: Write directly to SQLWrite SQL statements directly, the SQL statement itself can have transactions, have transactions, in the stored procedure using the BEGIN TRAN,COMMIT Tran rollback TRAN. Advantages:
Query table name in 1.SQL Server 2000
Often encountered some forget the table name, at this time only remember the approximate, at this time can be queried system table sysobjects find the table name you want, if you want to find the name of the
Start:
--------------------------------------------------------------------------------
On the network, you see the methods of encrypting and decrypting SQL Server 2000 and SQL Server 2005 stored procedures, and then you analyze the code and find
First the code, you can see the SQL statement to remove duplicate records, get duplicate records
Copy Code code as follows:
ALTER procedure [dbo]. [Proc_itemmaster_getunique] @PAGEINDEX int, @uid int, @itemnumber varchar (50)
As
transactions and locks in SQL Server
The transaction is all about Atomicity (atomicity). The concept of atomicity refers to the idea that some things can be treated as a unit. From a database standpoint, it refers to the smallest combination of one
1. What is a transaction: a transaction is an indivisible working logical unit that is used as the smallest control unit when performing concurrent operations on a database system.
All of the database operations commands he contains are either
A trigger is a special type of stored procedure that differs from the stored procedure we described earlier. Triggers are triggered primarily by events that are automatically invoked to execute. Stored procedures can be invoked by the name of the
Similarly, backing up the transaction log only truncates the part of the transaction log for inactive transactions, so open transactions can cause more logs (or even physical limitations) until the transaction is committed or rolled back.
To find
Environment: SQL Server or 2008
Recently, when dealing with a lock problem, found a more depressing thing, using X lock can not lock the query, simulate this problem, you can use the following T-SQL script to establish a test environment.
Use master;
When a transaction is used in a stored procedure, if there is no Try...catch statement, when set XACT_ABORT on, if an error occurs, all SQL operations are automatically rolled back after the batch statement is completed.
When set Xact_abort off, if
In the process of preparing a database interview, first on the Internet a sea search, to find the history of interview questions, and then a bone a bone after the gnawing, now basically these problems (or called practice) are no problem. The
The garden has a very good article about SQL Server transaction isolation, feeling a lot of the introduction from the concept, for those beginners, see the touch of understanding is profound, so no longer repeat, the emphasis is on the example
There is more than one solution to this problem:
Build a table first
CREATE TABLE Products (
ProductID int,
ProductName varchar (40),
Unit char (2),
UnitPrice number
)
Then add some ProductName and the unit are the same data.
1. The next step is to
Stored Procedure format:CREATE PROCEDURE yourprocedure asbegin SET NOCOUNT on; BEGIN TRY---------------------start catching exception BEIN TRAN------------------start transaction UPDATE A SET a.names= B.names from T1 as A INNER joins T2 as B on a.id
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service