This repository has been archived on 2024-12-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Databases/Lab10/Task3.sql
2022-10-26 04:27:12 +03:00

20 lines
518 B
SQL

SELECT resource_type, request_mode, request_type, request_status,
request_session_id
FROM sys.dm_tran_locks
/*
Update a record in the Person.Contact table in the AdventureWorks database.
*/
USE AdventureWorks
BEGIN TRANSACTION
UPDATE Person.Contact
SET FirstName = 'Fran'
WHERE ContactID = 6
-- For the purpose of the exercise, COMMIT TRANASACTION or ROLLBACK TRANSACTION are not used.
SELECT @@spid AS 'spid'
-- Use the SPID to identify the connection when using sys.dm_tran_locks.
ROLLBACK TRANSACTION