Usage of OpenRowSet and OpenDataSource in SQL Server

xiaoxiao2021-03-06  81

Select * from OpenRowset ('sqloledb.1', 'mrp-server'; 'sa'; '123', dbdata.dbo.tbg_gzzl)

Select a. * From OpenRowSet ('Microsoft.jet.OleDb.4.0', 'D: /aa.xls'; 'admin'; '', DATA) AS A below can succeed, the next day statement is not: OLE DB Provider 'Microsoft.jet.OleDb.4.0' error. [OLE / DB Provider Returned Message: Unrecognizable database format 'D: /aa.xls'. ] Select * from OpenDataSource ('microsoft.jet.oledb.4.0', 'data source = "d: /aaa.xls"; user ID = admin; password =; extended property = Excel 5.0') ... Data $

Select * from OpenDataSource ('microsoft.jet.oledb.4.0', 'data source = "c: /account.xls"; user ID = admin; password =; extended profit = excel 5.0') ... ABC $

insert into OPENDATASOURCE ( 'sqloledb', 'Data Source = mrp-server; User ID = sa; Password = 12345') voutmmstdata.dbo.zcctest (cust_no, cust_name) SELECT cust_no, cust_nameFROM OpenDataSource ( 'Microsoft.Jet.OLEDB.. 4.0 ',' Data Source = "C: /111.xls"; user ID = admin; password =; Extended Properties = Excel 5.0 ') ... getBom1 $

Select * from OpenDataSource ('sqloledb', 'data source = mrp-server; user ID = sa; password = 12345'). VOUTMMSTDATA.DBO.ZCCTEST

Delete from OpenDataSource ('sqloledb', 'data source = mrp-server; user ID = sa; password = 12345'). VOUTMMSTDATA.DBO.ZCCTEST

This statement can also be run successfully when the Access database does not have a password, plus the password after the password is written, but not: ABC password.

Select a. * From OpenRowSet ('Microsoft.jet.OleDb.4.0', 'D: /Demo.dat'; 'Admin'; 'ABC', TEMP) AS A

转载请注明原文地址:https://www.9cbs.com/read-121662.html

New Post(0)