且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

自动更新软件的数据库

更新时间:2023-02-08 17:30:55

vpmanu写道:

我们如何添加加法表到较旧的数据库

how can we add the addition tables to the older database



取决于.
假设对于SQL Server,
查询就像:



Depends.
Suppose for SQL Server,
the Query is like:

CREATE TABLE table_name
("column 1" "data_type_for_column_1",
"column 2" "data_type_for_column_2",
... )


或者,您也可以使用企业管理器,它不需要您编写查询.
:rolleyes:


Or you can also use Enterprise Manager which would not need you to write queries.
:rolleyes:


您如何分发此更新?

首先,应将应用程序设计为不需要全新的数据库.添加新功能所需的其他表.如果存在架构更改,则应用程序应处理版本之间的差异.即读取较旧的格式,但写入新的格式.

使用Windows Installer之类的安装程序,并添加更新数据库所需的所有自定义模块.
How are you distributing this update?

First the application should have been designed to not require a completely new database. Add the additional tables required for the new functionality. If there are schema changes, then the app should handle the differences between versions. i.e read an older format but write the new format.

Use a setup program, like Windows Installer, and add any custom modules necessary to update the database.


感谢您的答复,以及如何将添加表添加到较旧的数据库中,请提供一些示例代码.
谢谢.
Thank you for your reply, and how can we add the addition tables to the older database, Please give some example codes.
Thanking you.