OPENROWSET is a T-SQL function that can be used in Microsoft SQL Server to read remote data from an OLE DB data source. It also supports bulk operations that can read data from a file and return it as a rowset.
OPENROWSET
is a T-SQL (Transact-SQL) function that can be used to read remote data from many sources, for example an OLE DB data source or a file from the file system.
This method is an alternative to accessing tables in a linked server and is a one-time, ad hoc
method of connecting and accessing remote data by using OLE DB. For more frequent references to OLE DB data sources, use linked servers instead.
OPENROWSET
also supports bulk operations through a built-in BULK
provider that enables data from a file to be read and returned as a rowset.
The OPENROWSET
function can be referenced in the FROM
clause of a query as if it were a table name. The OPENROWSET
function can also be referenced as the target table of an INSERT
, UPDATE
, or DELETE
statement, subject to the capabilities of the OLE DB provider. Although the query might return multiple result sets, OPENROWSET
returns only the first one.