Сделана 10 лаба

This commit is contained in:
2022-10-26 04:27:12 +03:00
parent c96fca8bc7
commit b4cf7ebb8c
5 changed files with 81 additions and 0 deletions

19
Lab10/Task1.sql Normal file
View File

@@ -0,0 +1,19 @@
/*
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'