用友U8 如何用SQL查询直接读取其他数据源用友U8 如何用SQL查询直接读取其他数据源
问题原因:如何用SQL查询直接读取其他数据源 解决方法:USE ufdata_999_2001SELECT top 1 'ACCESS'as 数据库, [cSysID], [cID], [cName], [cCaption], [cType], [cValue], [cDefault], [bVisible], [bEnable]FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:\temp\fq.mdb';'admin';'', accinformation) union allSELECT top 1 'SQLOLEDB',a.[cSysID], [cID], [cName], [cCaption], [cType], [cValue], [cDefault], [bVisible], [bEnable]FROM OPENROWSET('SQLOLEDB','(local)';'sa';'', 'select * from ufdata_999_2001..accinformation') AS aunion allSELECT top 1 'MSSQL',[cSysID], [cID], [cName], [cCaption], [cType], [cValue], [cDefault], [bVisible], [bEnable]from accinformation
解决方案:
问题原因:如何用SQL查询直接读取其他数据源 解决方法:USE ufdata_999_2001SELECT top 1 'ACCESS'as 数据库, [cSysID], [cID], [cName], [cCaption], [cType], [cValue], [cDefault], [bVisible], [bEnable]FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'c:\temp\fq.mdb';'admin';'', accinformation) union allSELECT top 1 'SQLOLEDB',a.[cSysID], [cID], [cName], [cCaption], [cType], [cValue], [cDefault], [bVisible], [bEnable]FROM OPENROWSET('SQLOLEDB','(local)';'sa';'', 'select * from ufdata_999_2001..accinformation') AS aunion allSELECT top 1 'MSSQL',[cSysID], [cID], [cName], [cCaption], [cType], [cValue], [cDefault], [bVisible], [bEnable]from accinformation
www.kuaiji66.com 天龙瑞德