Information générale
Forum:
Microsoft SQL Server
Versions des environnements
SQL Server:
SQL Server 2005
Try creating just one string with the whole query (with embedded CR) and also you may want to use single quotes for string constants (but doubled when used in a string).
Also, why do you need to generate OPENQUERY dynamically? Have you tried it static?
Finally, do you have a direct access to that Oracle server and can you first try that query there?
Also, are you sure this is valid Oracle syntax
EXTRACT(YEAR FROM HT.TAP_DT), EXTRACT(MONTH FROM HT.TAP_DT),
yes I am sure that this is valid Oracle syntax. I have used OpenQuery like this many times before. The problem was that I was missing a beginning quote in this string:
HCT.SAMPLE_LOCATION IN ("SR", LF","LR")
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement