将列从开发数据库表添加到生产数据库表 [英] Add column from development database table to production database table

查看:211
本文介绍了将列从开发数据库表添加到生产数据库表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,当开发数据库中的某些表添加了更多列时,现在我应该在生产数据库中添加该列。

I got an issue When some table on the development database has more columns added, and right now I should add the column in the production database.

我尝试通过在表树上添加列手动添加列,但是当我尝试保存时,它显示了警告

I try to add the column manually, by Add Column on Table Tree, but when I try to save, it show me a warning:

这是完整的警告消息:


Saving Definition Changes to tables with large amounts of data could take a 
 considerable amount of time. While changes are being saved, 
 table data will not be accessible.


这样安全吗?还是有另一种方法?

is this safe? or is there another method to do this ?

更新:我试图单击 c >,但几分钟后,它又给我另一个警告,提示超时,并且该过程被取消,是的,生产表中的数据非常庞大

UPDATE : I Tried to click Yes but after some minutes it give me another warning that said Time Out, and the process canceled, and yes the data in the production table is totally huge

推荐答案

基本上,这意味着SQL Server将遍历表(在磁盘上)中的所有记录并进行更改。
此操作将占用大量IO,并将表锁定为可读写状态。

Basically this means that the SQL server is going to go over all the records in the table (on disk) and change them. This is an operation that will take a lot of IO and will lock your table to reading / writing.

还有其他需要考虑的问题是数据库超时(如上所述)在
http://social.msdn.microsoft.com/Forums/sqlserver/zh-CN/7d46b158-a089-48c9-8153-53c5ed116d37/sql- 2005-使用大量数据更新表定义

Something else to consider is your DB timeout as mentioned in http://social.msdn.microsoft.com/Forums/sqlserver/en-US/7d46b158-a089-48c9-8153-53c5ed116d37/sql-2005-updating-table-definition-with-large-amounts-of-data-timeout

这是相对安全的(锁定问题除外),并且在您将要使用的任何方法中都会出现这种情况(可能没有不错的UI警告)。

This is relatively safe (except for the lock issue) and will be the case in any method you will use (maybe without the nice UI warning).

这篇关于将列从开发数据库表添加到生产数据库表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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