General information
Forum:
Microsoft SQL Server
Environment versions
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")
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only