You’ve got a couple of options on how to fix this.
1. Declare a variable, and put the checksum in the variable then use the variable in the query.
<pre>declare @checksum int = checksum(‘text_value’)
select 1 from table where computed_column = @checksum</pre>
2. Use an index hint to force the SQL Server to use the index.
<pre>Select 1 from table with (index(YourIndexName)) where computed_column = checksum(text_value)</pre>
Personally I would recommend #1.
Discuss This Question: