SSAS:如何重新创建和填充时间维度 SQL 表
出于部署原因,是否有任何命令或工具可以重新创建架构并将所需的时间数据填充到时间维度 SQL 表中?
我目前面临的问题是,仅在设计时间维度 SQL 表期间,向导才会填充表,之后似乎无法再次调用相同的过程。
有没有了解 VS 向导是如何工作的?也许这是一种可以通过脚本或类似方式调用的功能?
感谢您的帮助
Is there any command or tool that can recreate the schema and fill the needed time data into the time dimension SQL Table for deployment reason?
I'm currently facing the issue that only during designing the time dimension SQL Table the wizard is populating the table, afterwards there seems to be no way to invoke the same process again.
Is there any understanding how the VS Wizard does it's work`? Maybe it's a functionality one can invoke by a script or alike?
Thanks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该向导仅在设计时运行,因此如果您打算定期向时间维度添加记录,它不会帮助您进行常规部署。您可以简单地构建一个在标准 ETL 中运行的存储过程,该存储过程会自动添加其他数据行,类似于向导在设计时所做的操作。或者,您可以预填充更长的时间段,使用视图或命名查询来过滤到类似 WHERE DateKey < 的内容。 CONVERT(DATE, GETDATE()) 而不是使用直接表引用,然后使用名为查询的视图作为日期维度源表。这种方法的优点是,您可以使用向导生成非常大的时间维度,然后仅使用仓库中需要的内容。
The wizard only runs at design time, so it won't help you with regular deploys if you intend to regularly add records to the time dimension. You could simply build a stored procedure that runs in your standard ETL that automatically adds additional data rows similar to what the wizard did at design time. Alternatively, you could prepopulate a much larger period of time, use a view or named query that filters to something like WHERE DateKey < CONVERT(DATE, GETDATE()) instead of using a direct table reference, and then use the view named query as your date dimension source table. The advantage of this approach is that you could use the wizard to generate a very large time dimension and then only use what's needed in the warehouse.
一个更简单的解决方案是使用更大的数据集创建第二个时间维度,然后合并两个表中的记录,而不是重新创建时间维度表(如果它是在“数据源”上创建的)。如果重新创建时间维度,则必须重新链接数据源视图中的所有其他表/查询,并重新配置其他维度。
An easier solution instead of re-creating the time dimension table (if it was created on a "data-source") would be to create a second time dimension with a much larger data set and merge the records from both tables. If you re-create the time dimension then you will have to re-link all other tables/queries in your data source view as well as re-configure your other dimensions.