如何从 T-SQL 中的 DSN 中的表中选择数据?

发布于 2024-07-08 16:44:53 字数 69 浏览 6 评论 0原文

如何从只能通过 T-SQL MS SQL Server(任何版本)中的 ODBC 数据源 (DSN) 访问的数据库获取数据?

How can I get data from a database that I can only access through an ODBC Data Source (DSN) in T-SQL MS SQL Server, any version?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

伪心 2024-07-15 16:44:53

阅读完以下内容后,我决定创建 SSIS 包以通过 DSN 从另一个数据源获取数据。

有了链接服务器,你就有了一点
更加灵活,但也有一些
额外的安全问题。 你是
链接到其他数据源作为
特定用户,以及该用户的
链接服务器的权限。 如果
您所需要的只是只读访问
视图很少,该用户应该只是
将该权力授予那些
对象。 这还不错,你有
完全控制您的权限
授予该用户,但您必须
管理它并意识到授予
太多的权力可能是一种安全感
关心。

考虑使用链接服务器
从中复制数据的只读权限
永久的特定表/视图
代替其他数据库中的表
SSIS 包的。 您可以执行
作业定期复制
来自链接的适当数据
服务器到本地数据库和
引用您的本地表
应用。 可能会更容易
比 SSIS 更易于实施和维护
包,并且可能是
稍后更新以使其上线
解决方案。

来源

After reading the following, I decided to create SSIS packages to get data from another data source via DSN.

With Linked Servers, you have a little
more flexibility, but also some
additional security concerns. You are
linking to the other data source as a
specific user, with that user's
authority to the linked server. If
all you need is Read-only access to a
few views, that user should only be
granted that authority to those
objects. This isn't so bad, you have
total control of the authority you
grant to that user, but you have to
manage it and realize that granting
too much authority could be a security
concern.

Consider using a linked server with
read-only rights to copy data from
specific tables/view into permanent
tables in the other database in lieu
of an SSIS package. You can execute a
job periodically to copy the
appropriate data from the linked
server to the local database and
reference the local tables within your
application. It will likely be easier
to implement and maintain than an SSIS
package, and could potentially be
updated later to make it a live
solution.

Source

明媚殇 2024-07-15 16:44:53

选择是简单的部分,但真正的问题是如何连接到数据源。

首先,您从哪里选择数据? 您是在编写代码,还是仅使用查询分析器工具 (2000) 或 Management Studio (2005)?

无论如何,您都需要设置与数据库的连接。 如果您需要有关 DSN 连接字符串的帮助,网站 www.connectionstrings.com 会非常有帮助。 否则,查询工具中将会出现对话框或向导来帮助您。

The selecting is the easy part, but the real question is how do you connect to the datasource.

First, where are you selecting data from? Are you writing code, or just using the Query analyzer tool (2000) or Management Studio (2005)?

You'll need to setup your connection to the database regardless. If you need help with the connectionstrings to a DSN, the site www.connectionstrings.com is very helpful. Otherwise, from a query tool there will be dialog boxes or wizards to help you.

爱的故事 2024-07-15 16:44:53

您需要将链接服务器添加到源中,然后您可以像往常一样查询它。

You need to add a Linked Server to the source, then you can query it as usual.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文