I'm trying to create a persisted computed column using the hashbyte function. But when adding this column to my table I get a error message which says: Computed column 'check' in table 'tbl_cons' cannot be persisted because the column is non-deterministic.
My Alter Statement looks like this:
Alter TAble tbl_cons Add [check] AS (hashbytes('md5', isnull ([TICKER] ,'') + isnull ( convert(nvarchar, CPN) ,'') + ... )
It builds a hash out of ca. 200 columns. AFAIK hashbytes is non-deterministic for NULL values, but as I'm using isnull() this can never happen.
Before hashbytes I used checksum, but there have been changes on the underlying columns which didn't change the checksum.
Any chance to make this column persisting?