Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Location
    Andover, MA
    Posts
    256

    Unanswered: Using variables with OpenQuery

    I am 99% sure there is no way to do this (because it would make life way too easy), but does anyone know if a way to use a variable as the server name in an OpenQuery statement?

    Desired result:

    SELECT * FROM OPENQUERY([184],'SELECT * FROM base_conf')

    Tried:

    SELECT * FROM OPENQUERY(@server_id, 'SELECT @ FROM base_conf')

    TIA

    (come on blindman...)
    -bpd

  2. #2
    Join Date
    Aug 2003
    Location
    Andover, MA
    Posts
    256
    Just bumping this up so people see it. No ideas?
    -bpd

  3. #3
    Join Date
    Sep 2003
    Posts
    522
    blindman doesn't like openquery

  4. #4
    Join Date
    Aug 2003
    Location
    Andover, MA
    Posts
    256
    ...but sometimes, it's the only way...

    Writing queries for an old version of Informix. Can only get them to work as passthroughs (OpenQuery).
    -bpd

  5. #5
    Join Date
    Aug 2003
    Location
    Andover, MA
    Posts
    256
    ...but sometimes, it's the only way...

    Writing queries for an old version of Informix. Can only get them to work as passthroughs (OpenQuery).
    -bpd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •