![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
exec
sp_configure
'
show advanced options
'
,
1
reconfigure
exec sp_configure ' Ad Hoc Distributed Queries ' , 1
reconfigure
GO
SELECT * into #tempxx FROM openrowset ( ' SQLOLEDB ' , ' 服务器 ' ; ' 登录用户 ' ; ' 密码 ' , ' SELECT * FROM athletic.dbo.imatposcheckOnlineHD ' );
GO
exec sp_configure ' Ad Hoc Distributed Queries ' , 0
reconfigure
exec sp_configure ' show advanced options ' , 0
reconfigure
reconfigure
exec sp_configure ' Ad Hoc Distributed Queries ' , 1
reconfigure
GO
SELECT * into #tempxx FROM openrowset ( ' SQLOLEDB ' , ' 服务器 ' ; ' 登录用户 ' ; ' 密码 ' , ' SELECT * FROM athletic.dbo.imatposcheckOnlineHD ' );
GO
exec sp_configure ' Ad Hoc Distributed Queries ' , 0
reconfigure
exec sp_configure ' show advanced options ' , 0
reconfigure