Imagine a T-SQL query that needs to determine if something is on a date. There are two versions.
declare @theDate as date = convert(date,'1900-01-01');
select *
from someTable
where someTable.Date = @theDate;
and
select *
from someTable
where someTable.Date = convert(date,'1900-01-01');
In the second example, is it running the conversion once per row? Is there any performance benefit to always putting these in variables?
