简体   繁体   English

SQL 2008链接服务器连接

[英]SQL 2008 Linked Server Connection

Does a linked server connection on SQL Server 2008 get shared between connections to the SQL Server? SQL Server 2008上的链接服务器连接是否在与SQL Server的连接之间共享? I am wondering this because I have a SQL Server 2008 with a linked Sybase server. 我想知道这是因为我有一个带有链接的Sybase服务器的SQL Server 2008。 If I open up Management Studio and connect to the SQL Server and execute the following 如果我打开Management Studio并连接到SQL Server并执行以下命令

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. 然后在Management Studio中打开另一个窗口,再次执行该语句,我得到一个表已经存在。 The same things also seems to be happening if I execute it through code and then try it through Management Studio. 如果我通过代码执行它,然后通过Management Studio尝试它,似乎也会发生同样的事情。

Is the linked server connection being shared between different connections to the SQL Server or is something else going on? 链接服务器连接是在与SQL Server的不同连接之间共享还是在发生其他事情?

I confess my experience with Sybase is pretty limited, but does it use the OLE DB provider for the linked server? 我承认我在Sybase方面的经验非常有限,但是它是否对链接服务器使用OLE DB提供程序? If so, yes you should be getting connection pooling as OLE DB provides connection pooling. 如果是这样,是的,您应该获得连接池,因为OLE DB提供了连接池。

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. 并不是链接服务器和SQL Server之间的连接被重用,而是由于连接池而使SQL Server的连接被重用。

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

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