HashBytes with datetime2 field
问题 I am creating a hash key using hashbytes on multiple columns to get performance gain which we are using right now in where clause. alter table dbo.Table1 add HashKey AS CAST(hashbytes('MD5', PID+PNumber+CONVERT([varchar] (50),[DateStamp]) +CONVERT(VARCHAR(50), TransactionCount)+OCD+ONbr+TransactionID) AS VARBINARY(80)) PERSISTED But one of the column in that is a datetime2 field which i am unable to add. While i was trying i am getting below error message "Computed column 'HashKey' in table