Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I HATE OpenQuery!
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01548093
Message ID:
01548108
Vues:
62
AFAIK OpenQuery does not work with a variables as parameters, you need to create the string inside the function call, ie

set @SQL = 'SELECT * FROM TABLE'
select * from OpenQuery(ORACLE, @SQL) -> Fail
select * from OpenQuery(ORACLE, 'SELECT * FROM TABLE') -> Works

IOW, you need to build your complex string inside the function call



[UPDATE] Ah, I did not see you were using EXEC... then what I said does not apply, but I never tried either...
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform