生成两个diff版本的表的Alter脚本. [英] Generate Alter script of a table in two diff version.

查看:85
本文介绍了生成两个diff版本的表的Alter脚本.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




生成两个不同版本的表的更改脚本的任何方法.

如果数据库Dv1中有一个表T1,则在T1中添加一个额外的列,并将数据库命名为Dv2.

然后,我想生成该额外列的变更脚本.

使用SMO,我可以生成表的脚本,但是,如何比较这两个表并生成alter脚本.

有人有想法继续吗?

使用SQL SERVER 2008和C#/VB

Hi,


IS their any way to generate an alter script of a table, of two different versions.

If we have a table T1 in Database Dv1, an extra column is added in T1 and the database is named as Dv2.

Then i want to generate an alter script of that extra column.

Using SMO,I could generate scripts of the tables but, how can i compare these two tables and generate the alter script.

Do any one have an idea proceed.

Using SQL SERVER 2008 and C#/VB

推荐答案

有3种简单的方法,其中2种是免费的,但需要纪律

1.在每个纪元",在其上转储所有创建文件,运行winmerge或类似文件,然后手动创建更改
2.要求对DB结构的所有更改都必须使用alter脚本来完成,并只需将它们收集并合并
3.使用类似 Redgate的sqlcompare [
There are 3 easy ways to do it, 2 are free, but require discipline

1. At every ''epoch'', dump all the create files, run winmerge, or similar, over them and create the alters manually
2. Mandate that all changes to DB structure are done with alter scripts, and simply collect and coalesce them
3. use something like Redgate''s sqlcompare [^]

I''d personally recommend #2 - I have used Sql Compare, and bluntly, it''s brilliant, but #2 gives you traceability


这篇关于生成两个diff版本的表的Alter脚本.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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