简体   繁体   English

Wherescape / ETL / SQL DB Fact表-添加列

[英]Wherescape / ETL / SQL DB Fact tables - add columns

We have a star schema designed in Wherescape. 我们在Wherescape中设计了一个星型模式。 The task is to add new columns to the Fact table. 任务是向事实表添加新列。 The fact table have around 30gb in it. 事实表中大约有30GB。 Is it possible to add columns without deleting the fact table? 是否可以添加列而不删除事实表? Or what technique should be used to retain the current data in the fact table, and at the same time have the new columns available. 或者应该使用什么技术将事实数据保留在事实表中,同时使新列可用。 I keep getting a timeout error if I just try to add columns in management studio. 如果我只是尝试在Management Studio中添加列,则会不断收到超时错误。

I think the guy before me actually just modified it in Wherescape (not too sure). 我认为我之前的那个人实际上只是在Wherescape中对其进行了修改(不太确定)。 In anycase if I have to do it manually in management studio, that works for me too. 无论如何,如果我必须在Management Studio中手动进行操作,那对我也适用。

thanks Gemmo 谢谢杰莫

Can't really do this without deleting the table. 不删除表就无法真正做到这一点。 It's too big and no matter what you do, it will time out. 它太大了,无论您做什么,都会超时。 Back up the table, delete it and create the table with the new structure. 备份表,将其删除并使用新结构创建表。 You'll just have to put the data in again. 您只需要再次放入数据即可。 No shortcuts. 没有捷径。 For smaller tables, you can easily add a column no problem. 对于较小的表,您可以轻松添加列没有问题。

Best way to do this is to add the column to the metadata and then right click on your table/object and then click "Validate against the database". 最佳方法是将列添加到元数据中,然后右键单击表/对象,然后单击“针对数据库验证”。

  • this would allow you to alter the table instead of having to take the long route of moving data into a temp table, recreating the table and moving the data back. 这将使您能够更改表,而不必花很长的时间将数据移动到临时表,重新创建表并将数据移回的过程中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM