English 中文(简体)
在多个数据库中加入/更新
原标题:Insert/Update row in multiple databases

I have a project that involves Software as a Service. The app has one SystemDB and multiple customer databases. The customer databases are exactly the same(all tables are equal). The system databases contains a table with all the details from the customer databases like dbname, dbPassword,dbUsername, etc..

How can i do an update to all databases and make sure that the update is correct. For example. all db s have a translation table. I want to add a word to all tables. Or i want to update a word that has been misspelled. I have more than 50 db s that we are going to maintain. so manual work is not possible.

关于能够做到这一点的软件或框架的任何建议。

我正在使用PHP5.4.0,但还没有具体框架。 作为非行,我们使用MS Sql 2008R2

感谢

最佳回答

We have simillar situation to read from multiple database,our pl is C#.net. For that we have written a C#.net code which runs and connect to each database one by one and manages the data into a single server. I suggest you to go that way only and whatever scripts like update or insert sripts should be used as Excecute Query in .Net. In this we you will avoid manual work of connecting and updating.

问题回答

我将采用这种复制方法,而这种复制得到SQ服务器的默示支持。 复制允许你在你的系统数据库(出版商)上公布某些表格,并订阅一个或多个客户数据库(用户)的数据变动。 由于你只是把数据推向一个方向,并且正在反映某些表格和系统数据库,这将对你有益。

你们可以从SSMS中推广。 扩大目标探索者服务器下的复制处,正确点击“当地出版物”和选定出版物。 委托人将通过出版过程指导你的工作。 订阅费相同,为每个客户数据库设定订阅费。

由于你拥有许多客户数据库,因此,在使用t-sql创建订阅时,你将值得使用,然后在你的所有目标数据库中复制这一代码。 查阅 说明如何做到这一点。

使用数据库的触发点是更新其他数据库中的表格。





相关问题
what is wrong with this mysql code

$db_user="root"; $db_host="localhost"; $db_password="root"; $db_name = "fayer"; $conn = mysqli_connect($db_host,$db_user,$db_password,$db_name) or die ("couldn t connect to server"); // perform query ...

Users asking for denormalized database

I am in the early stages of developing a database-driven system and the largest part of the system revolves around an inheritance type of relationship. There is a parent entity with about 10 columns ...

Easiest way to deal with sample data in Java web apps?

I m writing a Java web app in my free time to learn more about development. I m using the Stripes framework and eventually intend to use hibernate and MySQL For the moment, whilst creating the pages ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How can I know if such value exists in database? (ADO.NET)

For example, I have a table, and there is a column named Tags . I want to know if value programming exists in this column. How can I do this in ADO.NET? I did this: OleDbCommand cmd = new ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...

热门标签