问题
The two most important fields, that are everywhere in our warehouse, are the UserAccountKey and the DateKey.
- DateKey is (int, not null)
- UserAccountKey is (int, not null)
Are these the correct data type?
The WH was created in 2006 so type Date
wasn't an option, although we are now running 2008-R2
so it is now an option for the next iteration of the WH. It's a well established WH with multiple cubes built from it and a whole reporting system. Additional question to the above is when the WH was created would the architect have been better having the DateKey as type Char(8)
rather than INT
?
回答1:
There's actually a data type especially for dates. I'd change the DateKey
type from int
to date.
来源:https://stackoverflow.com/questions/11170677/should-datekey-yyyymmdd-be-char8