SQL Server date vs smalldatetime -
i have bunch of tables consolidate data on different levels: quarterly, hourly, daily , monthly. apart there's base table contains "raw" data well, 1 contains columns. consolidated tables have same columns.
the base, quarterly , hourly tables make use of column of type smalldatetime timestamp data. column available in hourly , daily tables, of course won't need time aspect here.
for sake of simplicity want use smalldatetime data type here also, maybe it's better performance use date data type column?
is there big difference between types when comes down performance?
it's idea use smallest data type need. shouldn't use varchar(max) or varchar(10) store 2 character state abbreviation.
in same sense, if need date (e.g. 4/11/2001) use date type , not datetime type.
while might not huge gain in performance (datetime 5 bytes larger date.)it can start adding if have multiple fields and/or multiple rows.
Comments
Post a Comment