Home > Archive > MS SQL Server ODBC > June 2005 > OpenQuery









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author OpenQuery
Timothy Peer

2005-06-24, 3:23 am

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,

Tim Pee
Sue Hoegemeier

2005-06-28, 3:23 am

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
< TimothyPeer@discussi
ons.microsoft.com> wrote:

>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,
>
>Tim Pee


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com