我正在做一个项目,需要在IntegrationServices中的数据仓库服务器上进行查找。
我的问题是,我需要能够更改它执行查找的数据库。这些数据库在设计上是相同的。
我以前用一个脚本组件解决过这个问题,其中对于每一行,如果数据库id发生了变化,连接就会发生变化,如下所示
try {
if (databaseNr != Row.DatabaseNr) {
try {
databaseNr = Row.DatabaseNr;
currentCatalog = "db" + Row.DatabasNr;
connection.ChangeDatabase(currentCatalog);
} catch (Exception e) {
ComponentMetaData.FireWarning(0, ComponentMetaData.Name, e.Message, "", 0);
}
}
string command = "SELECT Id, Name, Surname FROM [" + currentCatalog + "].[TableName] WHERE Id = '" + Row.OrderID + "'";
但是,如果查找组件可以做到这一点,我会省去很多麻烦。
所以我的问题是:是否可以使用列数据以任何方式更改要使用查找组件执行查找的数据库?
感谢你的帮助!