简体   繁体   English

MaxDB 数据和架构导出到 SQL Server 2005/8

[英]MaxDB Data and Schema Export to SQL Server 2005/8

I am tasked with exporting the data contained inside a MaxDB database to SQL Server 200x.我的任务是将 MaxDB 数据库中包含的数据导出到 SQL Server 200x。 I was wondering if anyone has gone through this before and what your process was.我想知道是否有人以前经历过这个以及你的过程是什么。

Here is my idea but its not automated.这是我的想法,但它不是自动化的。

1) Export data from MaxDB for each table as a CSV. 1) 将每个表的数据从 MaxDB 导出为 CSV。 2) Clean the CSV to remove ? 2) 清理 CSV 以删除 ? (which it uses for nulls) and fix the date strings. (它用于空值)并修复日期字符串。 3) Use SSIS to import the data into tables in SQL Server. 3) 使用 SSIS 将数据导入 SQL Server 中的表中。

I was wondering if anyone has tried linking MaxDB to SQL Server or what other suggestions or ideas you have for automating this.我想知道是否有人尝试将 MaxDB 链接到 SQL Server,或者您有什么其他建议或想法来实现自动化。

Thanks.谢谢。 AboutDev.关于开发

I managed to find a solution to this.我设法找到了解决方案。 There is an open source MaxDB library that will allow you to connect to it through .Net much like the SQL provider.有一个开源 MaxDB 库,它允许您像 SQL 提供程序一样通过 .Net 连接到它。 You can use that to get schema information and data, then write a little code to generate scripts to run in SQL Server to create tables and insert the data.您可以使用它来获取架构信息和数据,然后编写一些代码来生成脚本以在 SQL Server 中运行以创建表并插入数据。

MaxDb Data Provider for ADO.NET ADO.NET 的 MaxDb 数据提供程序

If this is a one time thing, you don't have to have it all automated.如果这是一次性的事情,您不必将其全部自动化。

I'd pull the CSVs into SQL Server tables, and keep them forever, will help with any questions a year from now.我会将 CSV 提取到 SQL Server 表中,并永久保留它们,这将有助于解决一年后的任何问题。 You can prefix them all the same, "Conversion_" or whatever.您可以为它们添加前缀“Conversion_”或其他任何内容。 There are no constraints or FKs on these tables.这些表上没有约束或 FK。 You might consider using varchar for every column (or the ones that cause problems, or not at all if the data is clean), just to be sure there are no data type conversion issues.您可能会考虑对每一列(或导致问题的列,或者如果数据干净则根本不使用)使用 varchar,以确保没有数据类型转换问题。

pull the data from these conversion tables into the proper final tables.将这些转换表中的数据提取到正确的最终表中。 I'd use a single conversion stored procedure to do everything (but I like tsql).我会使用单个转换存储过程来完成所有操作(但我喜欢 tsql)。 If the data isn't that large millions and millions of rows or less, just loop through and build out all the tables, printing log info as necessary, or inserting into exception/bad data tables as necessary.如果数据不是那么大的数百万行或更少,只需循环并构建所有表,根据需要打印日志信息,或根据需要插入异常/错误数据表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM