连接多个数据库的最佳做法是什么?

连接多个数据库的最佳做法是什么?

问题描述:

大家好



我们有8个数据库和一个应用程序。我们必须从下拉列表中选择的数据库中获取详细信息或插入数据库。

我们有以下两个连接选项:

1.始终连接到singale数据库,然后使用选定的DBNAME.DBO.TableName来获取数据

2.直接连接到特定的选定数据库并获取记录。



任何人都可以建议哪种连接方式是正确的?>


问候

Willington

Hi All

We have 8 databaes and one application. We have to fetch details from or insert to database which is selected in a dropdownlist.
We have the below two options to connect:
1. Always connect to singale database and then use selected DBNAME.DBO.TableName to fetch the data
2. Directly connect to the particular selected database snd fetch the records.

Could anyone suggest which is the correct way of connecting to a database?

Regards
Willington

hi,

第一个是最好的一个。如果你选择第二个,你可能会使用第一个选项。例如,您需要从db1和db2获取记录集,您必须再次使用第一个选项。我会建议第一个。



问候,

Prakash.T

First one is best one. if u go with second one, u may have use first option. For an example, you need get record set from db1 & db2, you have to use again first option only. I will suggest First one.

Regards,
Prakash.T