OPENQUERY() – Query timeout expired, really?

Did you receive this error while using an OPENQUERY() statement?:

OLE DB provider “SQLNCLI10” for linked server “[LinkedServerName]” returned message “Query timeout expired”.
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider “SQLNCLI10” for linked server “[LinkedServerName]” reported an error. Execution terminated by the provider because a resource limit was reached.
Msg 7320, Level 16, State 2, Line 1
Cannot execute the query ”

You might want to try helping the SQL Engine a little bit, because it’s confused by your query 😀
Try adding a TOP-clause, like for example:
SELECT TOP 3000000 *

If that didn’t help, you can always increase the timeout settings in the Server Properties window or Linked Server Properties window:

Server-Properties-Remote-Query-Timeout


Linked-Server-Properties-TimeOuts








Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s