简体   繁体   English

从Access和SQL表连接数据

[英]Joining data from Access and SQL tables

I have one access table like this 我有一个像这样的访问表

id     FrstName     LastName     Status
=================================================
1      John          Smith          1
2      Mike          Black          0

This is table from Project 1. I have to work on Project 2 where I have SQL table. 这是项目1的表。我必须在项目2上工作,我有SQL表。 In this project I need to combine data from access (Project 1) and data from SQL (Project 2). 在这个项目中,我需要组合来自访问(项目1)的数据和来自SQL(项目2)的数据。

Is there a way that I join table from SQL with table from access? 有没有办法从SQL连接表中的表来访问?

您可以通过选项Linked Server链接 SQL Server中的访问数据库,然后您可以使用它进行查询。

You have two options: 您有两种选择:

  1. Create a linked server in DB invironment, then create a SP to take care of it. 在DB环境中创建链接服务器,然后创建一个SP来处理它。

  2. Get two DataSets for them, then merge two datatables into one based on ID. 为它们获取两个DataSet,然后根据ID将两个数据表合并为一个。

Hope it gives you some idea. 希望它能给你一些想法。

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

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