3 ms·
It depends on context, for example this is true for SQL server if you have a filtered index based on datetime. If you use a constant or set a @variable ahead o
by rileymat2 4y ago
It depends on context, for example this is true for SQL server if you have a filtered index based on datetime.
If you use a constant or set a @variable ahead of time, it will use the filtered index, but if you just use =now() equivalent
(or in SQL server GETDATE()) it will not.
(You may also need to use OPTION(Recompile))