all groups > sql server odbc > june 2005 >
You're in the

sql server odbc

group:

OpenQuery



OpenQuery Timothy Peer
6/23/2005 9:34:04 PM
sql server odbc: I wish to send dynamic SQL to Openquery but it seems OpenQUERY only accepts
string constants. Any advise on how to do this. It would convenient if
Openquery could execute similar to dynamic SQL EXEC.

Please advise.

Regards,

Re: OpenQuery Sue Hoegemeier
6/27/2005 8:07:41 PM
If you need it to be dynamic, you can build the entire
string that does the Openquery statement. Pass that string
into an EXEC. You can find examples in the following
article:
HOW TO: Pass a Variable to a Linked Server Query
http://support.microsoft.com/?id=314520

-Sue

On Thu, 23 Jun 2005 21:34:04 -0700, Timothy Peer
[quoted text, click to view]
AddThis Social Bookmark Button