Database Reference
In-Depth Information
SELECT * FROM dbo.WEF_Passwords
GO
DELETE FROM dbo.WEF_Passwords
GO
INSERT TOP (200)
INTO WEF_Passwords(fullname, per_web_login, per_web_
password)
VALUES ('Marketing User', 'MarketUser', 'M@rket1'),
('Inventory User','InventryUser','In&vent9'),
('Business User','BizUser','B7$user'),
('SysAdmin','SA','$ySadm1n')
GO
UPDATE dbo.WEF_Passwords
SET per_web_password='Inv3n&'
WHERE per_web_login='InventryUser'
GO
7.
To obtain the current data version, we can use the SELECT CHANGE_TRACKING_
CURRENT_VERSION() function, where the returned value can be deemed as a
current version to determine the changes at a later stage.
8.
Furthermore, to detect the changes on the data, we can use the CHANGETABLE
function that returns a specific synchronized version and the latest change tracking
version for the rows. The two keywords CHANGE and VERSION are used as follows:
SELECT Per_id,SYS_CHANGE_OPERATION,
SYS_CHANGE_VERSION
FROM CHANGETABLE
(CHANGES dbo.WEF_Passwords, 0) AS CT
9.
The previous query will return the DML operations occurred on the dbo.WEF_
Passwords table based on the Per_id primary key value:
Per_id SYS_CHANGE_
OPERATION
SYS_CHANGE_
VERSION
SYS_CHANGE_COLUMNS
1
I
1
NULL
2
I
1
NULL
3
I
1
NULL
4
I
1
NULL
13
D
3
NULL
14
D
3
NULL
15
D
3
NULL
16
D
3
NULL
20
I
6
NULL
Search WWH ::




Custom Search