网络编程
位置:首页>> 网络编程>> 数据库>> SQLServer 连接 EXCEL

SQLServer 连接 EXCEL

 来源:dajiaozi.com 发布时间:2009-07-09 19:00:00 

标签:sqlserver,excel,数据库

启用Ad Hoc Distributed Queries:

exec sp_configure 'show advanced options',1
reconfigure

exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

使用完成后,关闭Ad Hoc Distributed Queries:

exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure

exec sp_configure 'show advanced options',0
reconfigure

SELECT *
FROM OPENDATASOURCE(
'SQLOLEDB',
'Data Source=ServerName;User ID=sa;Password=sa'
).DataBaseName.dbo.Table
select * from openrowset( 'SQLOLEDB ', 'IP地址'; '用户名'; '密码',数据库名.dbo.表名)

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com