SQL 2008 链接服务器连接

发布于 2024-10-03 19:08:18 字数 398 浏览 0 评论 0原文

SQL Server 2008 上的链接服务器连接是否在 SQL Server 的连接之间共享?我想知道这一点,因为我有一个带有链接 Sybase 服务器的 SQL Server 2008。如果我打开 Management Studio 并连接到 SQL Server 并执行以下命令

exec('select id into #tempTable from test') AT LINKEDSERVER

,然后在 Management Studio 中打开另一个窗口并再次执行该语句,我会得到一个表已经存在。如果我通过代码执行它,然后通过 Management Studio 尝试它,似乎也会发生同样的事情。

链接服务器连接是否在 SQL Server 的不同连接之间共享,或者是否发生其他情况?

Does a linked server connection on SQL Server 2008 get shared between connections to the SQL Server? I am wondering this because I have a SQL Server 2008 with a linked Sybase server. If I open up Management Studio and connect to the SQL Server and execute the following

exec('select id into #tempTable from test') AT LINKEDSERVER

And then open up another window in Management Studio and execute the statement again I get a table already exists. The same things also seems to be happening if I execute it through code and then try it through Management Studio.

Is the linked server connection being shared between different connections to the SQL Server or is something else going on?

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

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

发布评论

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

评论(2

樱花落人离去 2024-10-10 19:08:18

我承认我使用 Sybase 的经验非常有限,但是它是否使用 OLE DB 提供程序作为链接服务器?如果是这样,那么您应该获得连接池,因为 OLE DB 提供了连接池。

I confess my experience with Sybase is pretty limited, but does it use the OLE DB provider for the linked server? If so, yes you should be getting connection pooling as OLE DB provides connection pooling.

赴月观长安 2024-10-10 19:08:18

看来这是一个连接池问题。这并不是说链接服务器和 SQL Server 之间的连接被重用,而是因为连接池的原因,到 SQL Server 的连接被重用了。

It appears that this was a connection pooling issue. It wasn't that the connection between the linked server and SQL Server was getting reused, it was that the connections to the SQL Server were getting reused because of connection pooling.

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