/**********************************************************************************************
-- Title : [2k5] CHECKSUM_AGG를 활용한 테이블 변경 사항 체크
-- Reference : dbrang.com
-- Key word : 체크섬 checksum_agg 해쉬 hash
**********************************************************************************************/
use adventureworks;
go
select checksum_agg(cast(quantity as int))
from production.productInventory;
go --262
update production.productInventory
set quantity=125
where quantity=103;
go -- 변경건 없음.
select checksum_agg(cast(quantity as int))
from production.productInventory;
go --262
update production.productInventory
set quantity=125
where quantity=100;
go -- 7건 변경.
select checksum_agg(cast(quantity as int))
from production.productInventory;
go --287(checksum_agg값 변경됨)