DateKey YYYYMMDD是否应为char(8)? [英] Should DateKey YYYYMMDD be char(8)?

查看:137
本文介绍了DateKey YYYYMMDD是否应为char(8)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仓库中到处都是两个最重要的字段,分别是UserAccountKey和DateKey。

The two most important fields, that are everywhere in our warehouse, are the UserAccountKey and the DateKey.


  • DateKey是(int,不为空)

  • UserAccountKey为(int,不为空)

这些是正确的数据吗

WH创建于2006年,所以虽然我们现在正在运行,但类型 Date 不是一个选项。 2008-R2 ,因此它现在是WH的下一个迭代的选项。这是一个完善的WH,其中包含多个多维数据集和整个报告系统。上面的 Additional 问题是创建WH时架构师最好将DateKey设置为 Char(8)类型而不是 INT

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?

推荐答案

实际上有一种数据类型,特别是日期类型。我将 DateKey 类型从 int 更改为 date

There's actually a data type especially for dates. I'd change the DateKey type from int to date.

这篇关于DateKey YYYYMMDD是否应为char(8)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆