This documentation is archived and is not being maintained.


Replaces the source data query with a query to an external provider. The INSERT, SELECT FROM PREDICTION JOIN, and SELECT FROM NATURAL PREDICTION JOIN statements support OPENROWSET.



An OLE DB provider name.


The OLE DB connection string for the specified provider.


A query syntax that returns a rowset.

The data mining provider will establish a connection to the data source object by using provider_name and provider_string, and will execute the query specified in query_syntax to retrieve the rowset from the source data.

Use of ad hoc distributed queries is disabled as part of the default security configuration. A system administrator can enable the use of ad hoc distributed queries by using sp_configure. For more information, see Surface Area Configuration.

The following example can be used within a PREDICTION JOIN statement to retrieve data from the AdventureWorks database by using a Transact-SQL SELECT statement.

('SQLNCLI','Server=AdventureWorksDW;Trusted_Connection=yes;','SELECT TOP 1000 * FROM vTargetMail'