Загрузил скрипты лаб 1-7
This commit is contained in:
20
Скрипты и задания/Tran1.sql
Normal file
20
Скрипты и задания/Tran1.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Starts a transaction to read the record of
|
||||
Linda Gonzales and update her first name.
|
||||
Second select shows the uncommitted update.
|
||||
@@trancount shows the number of open transactions.
|
||||
*/
|
||||
|
||||
USE AdventureWorks
|
||||
|
||||
-- START TRANSACTION HERE
|
||||
BEGIN TRANSACTION
|
||||
SELECT @@trancount AS 'Transaction Count'
|
||||
SELECT FirstName, MiddleName, LastName FROM Person.Contact WHERE ContactID = 342
|
||||
UPDATE Person.Contact SET FirstName = 'Lin' WHERE ContactID = 342
|
||||
-- END TRANSACTION HERE
|
||||
COMMIT TRANSACTION
|
||||
|
||||
SELECT FirstName, MiddleName, LastName FROM Person.Contact WHERE ContactID = 342
|
||||
SELECT @@trancount AS 'Transaction Count'
|
||||
|
||||
Reference in New Issue
Block a user