简体   繁体   English

如何计划在64位Windows Server 2012上从dbf到SQL Server的数据插入

[英]How to schedule data insertion from dbf to SQL Server on 64-bit Windows Server 2012

I am working on a Windows Server 2012 64-bit. 我正在使用Windows Server 2012 64位。 I want to be able to import data from a .dbf file into a SQL Server table. 我希望能够将数据从.dbf文件导入到SQL Server表中。 I used the import wizard and it worked correctly. 我使用了导入向导,它可以正常工作。 However, I have SQL Server Express and can't schedule this insertion. 但是,我有SQL Server Express,并且无法安排此插入。

Is there another way to schedule the insertion of the .dbf data to the SQL Server tables, without the use of the SSIS package loader? 是否有另一种方法可以安排在不使用SSIS包加载器的情况下将.dbf数据插入SQL Server表中?

Update 更新资料

I ended up using Python and writing a script to import from XML. 我最终使用Python并编写了一个从XML导入的脚本。 However, I believe the answer by @Oleg was the most accurate, given the circumstances. 但是,在这种情况下,我认为@Oleg的回答是最准确的。

Thank you all! 谢谢你们!

I suggest you the next approach: 我建议您使用下一种方法:

  1. Create C# script which will use the OleDbConnection (to fetch) and SqlConnection (to upload) objects to import data from the .DBF file to SQL Server database table. 创建C#脚本,该脚本将使用OleDbConnection (以获取)和SqlConnection (以上传)对象将数据从.DBF文件导入SQL Server数据库表。
  2. By using LinqPad , LinqPad command-line utility ( lprun.exe ) and windows Scheduled Task service automate the execution of the mentioned script file 通过使用LinqPad ,LinqPad命令行实用程序( lprun.exe )和Windows Scheduled Task服务,可以自动执行上述脚本文件

Useful links: 有用的链接:

How to get data from DBF file using C# 如何使用C#从DBF文件获取数据

How to load data into datadase using C# 如何使用C#将数据加载到datadase中

About LINQPad command-line utility 关于LINQPad命令行实用程序

Another way is create a SQL linked server an ODBC that is pointing at the DBF. 另一种方法是创建一个SQL链接服务器和一个指向DBF的ODBC。 Use Windows scheduler to call SQLCMD.EXE to run some SQL to copy the data in. 使用Windows调度程序调用SQLCMD.EXE来运行一些SQL复制数据。

You can also use DBF Commander Pro for this task: 您也可以使用DBF Commander Pro来完成此任务:

  1. Create command line for your insertion - choose 'File -> Export to DBMS'. 为插入创建命令行-选择“文件->导出到DBMS”。 Specify transfer options in the window appears, then copy the command line from the bottom of the window: 在窗口中显示“指定传输选项”,然后从窗口底部复制命令行: 将DBF导出到数据库

  2. Create text .BAT file and insert the copied command line, eg: 创建文本.BAT文件并插入复制的命令行,例如:

    "c:\\Program Files\\DBFCommander\\DBFCommander.exe" -edb "D:\\Data\\customer.dbf" customer_table "Provider=SQLOLEDB.1;User ID=user1;Initial Catalog=test_db;Data Source=test_server" “ c:\\ Program Files \\ DBFCommander \\ DBFCommander.exe” -edb“ D:\\ Data \\ customer.dbf” customer_table“ Provider = SQLOLEDB.1;用户ID = user1;初始目录= test_db;数据源= test_server”

  3. Make a schedule using Windows Scheduler that will execute this .BAT file. 使用Windows Scheduler计划将执行此.BAT文件的计划。

Additional info that may be useful for you: 可能对您有用的其他信息:

Using DBF in batch mode 在批处理模式下使用DBF
Export DBF file to SQL database 将DBF文件导出到SQL数据库

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

相关问题 试图将数据从 Excel 加载到 SQL Server。 32 位 Excel 和 64 位 SQL Server 引发错误 - Trying to Load Data from Excel into SQL Server. 32-bit Excel and 64-bit SQL Server Throws Error 从64位SQL Server到Informix数据源的ODBC连接 - ODBC connection from 64-bit SQL Server to Informix data source 我是否需要64位工具和基础结构才能使用Microsoft SQL Server 2012 BI工具 - Do i need 64-bit tools and infrastructure to use Microsoft SQL Server 2012 BI tools SQL Server 2014 32 位在 Windows Server 2012 R2 中升级 64 位 - SQL Server 2014 32 bit upgrading 64 bit in Windows Server 2012 R2 如何从部署在64位服务器上的SSIS包访问Excel数据源? - How do I access Excel data source from an SSIS package deployed on a 64-bit server? 登录SQL Server 2012时出现问题(64位) - Problems logging into SQL Server 2012 (64 Bit) 如何在64位SQL Server 2005上设置DB2链接服务器? - How to set up a DB2 linked server on a 64-bit SQL Server 2005? 尝试在 win 7 上安装 SQL Server 2012。它是 64 位机器。 我收到以下错误 - Trying to install SQL Server 2012 on win 7. Its a 64-bit machine. I get the following error 如何从SQL Server 2012中进行计划表查询? - How to make a schedule table query from SQL Server 2012? 升级到64位后出现怪异的SQL Server内存错误 - Weird SQL Server memory errors after upgrading to 64-bit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM