PDA

View Full Version : MS SQL Date indexing


Lafriks
09-06-2005, 10:53 AM
Does MS SQL uses index when searching by date column? For example does mssql for such query will use date_field index:
select * from table where date_field between 'date1' and 'date2'

Thanks in advance,
Lafriks

nikkiH
09-06-2005, 05:02 PM
I don't see why it wouldn't, assuming someone actually created the index for that field.
You do need to create the index first, though. It doesn't index automatically, I don't think...