简体   繁体   English

从MS Access将数据附加到SQL Server

[英]Append data to SQL Server from MS Access

I have an Access database that pulls info from SQL Server. 我有一个Access数据库,它从SQL Server中提取信息。

I have linked Access files that work perfectly but the down side is sometimes our connectivity is not great and populating SQL Server from MS Access is very slow. 我已经链接了访问文件,它们可以正常工作,但缺点是有时我们的连接性不好,并且从MS Access填充SQL Server的速度非常慢。

What I would like to achieve is open the database in the morning have the data pulled down into access from SQL Server (Refresh), then work locally (offline mode) then at the end of the day hit a button that will append the changes into SQL Server. 我要实现的是早上打开数据库,将数据从SQL Server提取到数据库中(刷新),然后在本地工作(脱机模式),然后在一天结束时点击一个按钮,将所做的更改附加到SQL Server。

Not sure exactly what this process is called sorry if this is already covered. 如果已经涵盖了该过程,则不确定该过程到底叫什么对不起。

This process is called ETL - Extract, Translate, and Load. 此过程称为ETL-提取,翻译和加载。

I did this before when working in HR at a bank (SQL 2000 to MS ACCESS 2000). 在银行人力资源部门工作(SQL 2000到MS ACCESS 2000)之前,我曾这样做过。

Here are the steps you do. 这是您要做的步骤。

1 - Remove all data from target table in MS ACCESS.

2 - Drop any indexes, they will just add extra time.

This step is optional.

3 - Make sure there is a linked source table in MS ACCESS.

4 - Create a append table query.  
     In SQL terms, INSERT INTO <target table> SELECT * FROM <source table>

5 - Add back the indexes you dropped.

     This step is needed if you did step 2.

The good part about MS Access is that this can all be wrapped up in a MACRO to be executed. 关于MS Access的好处是,所有这些都可以包装在要执行的MACRO中。

The only bad thing is that credentials have to be supplied to MS ACCESS. 唯一的坏事是必须向MS ACCESS提供凭据。

If you look around, I am sure I have it in some deep dark corner of my software library that I have written, you can re-link them with a STANDARD SQL SERVER application account. 如果您四处看看,我确信它已经存在于我编写的软件库的某个深深的黑暗角落中,您可以将它们与STANDARD SQL SERVER应用程序帐户重新链接。 Do this at start up. 在启动时执行此操作。

Then, this issue will go away! 然后,这个问题就消失了!

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

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