Skip to main content

Posts

Showing posts with the label Using the OPENROWSET function in SQL Server

Using the OPENROWSET function in SQL Server

Whether you're bulk loading data or connecting to an OLE DB data source, OPENROWSET is a handy tool for retrieving data. Find out how to use the OPENROWSET function for SQL Server and Microsoft Access. There may be times when you'll want to run an ad hoc query that retrieves data from a remote OLE DB data source... or bulk loads data into a SQL Server table. In such cases, you can use the OPENROWSET function in Transact-SQL to pass a connection string and query to the data source in order to retrieve the necessary data. You can use the OPENROWSET function to retrieve data from any data sources that support a registered OLD DB provider, such as a remote instance of SQL Server or Microsoft Access. If you're using OPENROWSET to retrieve data from a SQL Server instance, that instance must be configured to permit ad hoc distributed queries. To configure the remote instance of SQL Server to support ad hoc queries, use the  sp_configure system stored procedure to ...