SQLTeam.com | Weblogs | Forums

Uniqueness of a tuple attributes after updating, performance critical

Say a record is defined with attribute A as primary key and some other attributes like B, C and D.
If now an update on record A1 is happened, then one or more values for B, C, D changed.

I worked with CHECKSUM(,, ) to check if an update of on a record is happened (e.g. a price change of an instrument). This because the performance is very essential to get the data processed and ready (so I cannot do a simple update on each column)

In certain cases the CHECKSUM deliver the same number even an update was happen.
see example for

CHECKSUM('Misc Partner - Central North - Central North')
CHECKSUM('Misc Partner - Central South - Central South')

I also can work with HASHBytes which can lead to same behavior.

What else can I try?
Kersten

hi

please see the below links if they help !!!

https://ask.sqlservercentral.com/questions/7253/limitations-w-using-checksum-for-comparing-data-wh.html

is this a hypothetical design question or is this real life actual problem you are facing?
Also depends on your design approach?

Is the price and other attributes for record A1 in the same table or in other tables?

Multi table design

create table assets(assetid int, assetname varchar(50))

insert into assets
select 1, 'headphones' union
select 2, 'usb wifi' union
select 3, 'wireless mouse'

create table assetprices(assetid int, price money, modifieddate datetime)
insert into assetprices
select 1, 50.34 union
select 2, 9.99 union
select 3, 47.33

Same table design

create table assets(assetid int, assetname varchar(50), price money)

insert into assets
select 1, 'headphones' , 55.00 union
select 2, 'usb wifi', 9.99 union
select 3, 'wireless mouse', 12.33