[英]How to import selective tables using SSIS based on custom (e.g.XML) file
I am having about 1200 tables in my oracle database and need to import them to SQL Server database. 我在我的oracle数据库中有大约1200个表,需要将它们导入SQL Server数据库。 But I would like to configure the import in such a way that at any given import, I should be able to select the tables that need to be imported.
但我想以这样的方式配置导入:在任何给定的导入中,我应该能够选择需要导入的表。
So, I have an custom XML file listing all the tables and a flag for each table indicating whether that table is to be imported or not. 因此,我有一个自定义XML文件列出所有表,并为每个表指示是否要导入该表。 Also I have created the package to import all the tables and would like to modify this to check table if that is to be imported from XML file at runtime.
我还创建了导入所有表的包,如果要在运行时从XML文件导入,我想修改它以检查表。
I was thinking to implement something like given here , but don't want to do this for these many tables and also don't know whether it'll do the job. 我想在这里实现类似的东西,但是不想为这么多表做这个,也不知道它是否能完成这项工作。
How can I get around this? 我怎么能绕过这个? Can I use SSIS configuration file for this (not sure though)?
我可以使用SSIS配置文件(不确定)吗? Is there any way that I can read XML at runtime and import tables based on XML file (or any other file with key-value pairs).
有没有什么办法可以在运行时读取XML并根据XML文件(或任何其他具有键值对的文件)导入表。
Any help in any form would be greatly appreciated. 任何形式的任何帮助将不胜感激。
It might seem a lot of work, but this is how I'd approach: 这似乎有很多工作,但这就是我的方法:
select PackageName from metadataTable where Flag =1
retrieves the list of packages that need to be executed. select PackageName from metadataTable where Flag =1
检索需要执行的包列表。 This whole setup reads the packages that needs to be executed, and executes them one after the other. 整个安装过程将读取需要执行的程序包,然后一个接一个地执行它们。
If you like this approach, check out Andy Leonard's SSIS framework . 如果您喜欢这种方法,请查看Andy Leonard的SSIS框架 。
Samuel Vanga has a solid approach. 塞缪尔·万加(Samuel Vanga)采取扎实的态度。 The only thing I would look at doing is using something to programmatically generate those 1200 packages.
我唯一要做的就是使用某些东西以编程方式生成这些1200包。
Depending on your familiarity with the SSIS object model and general .NET development, I'd investigate an EzAPI if you enjoy coding. 根据您对SSIS对象模型和一般.NET开发的熟悉程度,如果您喜欢编码,我会调查一个EzAPI 。
Otherwise, look at BIML and the package generation feature of BIDSHelper . 否则,看BIML和包产生的功能BIDSHelper 。 You do not need to by a license for Mist to create your BIML script, you can browse the existing scripts on BIMLScript and solve probably most of your needs.
您无需通过Mist许可证来创建BIML脚本,您可以浏览BIMLScript上的现有脚本并解决您的大部分需求。 Copy, paste, generate.
复制,粘贴,生成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.