以下的文章主要向大家讲述的是SQLServer 数据库函数,主要是OPENROWSET 与OPENDATASOURCE这两种,这两个函数不仅能实现从另外的数据库读数据,同时还能从EXCEL、TXT, ORACLE, ODBC 等读数据。
启用Ad Hoc Distributed Queries:
exec sp_configure ’show advanced options’,1 reconfigure exec sp_configure ’Ad Hoc Distributed Queries’,1 reconfigure SELECT * FROM OPENDATASOURCE( ’SQLOLEDB’, ’Data Source=SQLServerName;User ID=sa;Password=xxx’ ).Help.dbo.Help_Category
或
select * from openrowset( ’SQLOLEDB ’, ’SQLServerName’; ’sa’; ’xxx’, Help.dbo.Help_Category )
关闭Ad Hoc Distributed Queries:
exec sp_configure ’Ad Hoc Distributed Queries’,0 reconfigure exec sp_configure ’show advanced options’,0 reconfigure
以上的相关内容就是对SQLServer 数据库函数的介绍,望你能有所收获。
上述的相关内容就是对SQLServer 数据库函数的描述,希望会给你带来一些帮助在此方面。