troubleshooting Question

open query syntax for accessing oracle db from sql server

Avatar of parpaa
parpaa asked on
Oracle DatabaseMicrosoft SQL Server 2005
11 Comments1 Solution1718 ViewsLast Modified:
Hello experts
i am accessing oracle table information and feeding into my local sql server db. So in order to do that i have a SP written in sql server. Now my question is how to exactly write the logic to access the remote oracle DB
I have oracle ODBC connection created by "DSN = van_mart" and "tns service_name = mart" and "oraacleDB = orcdb82"

In sql server we qualify it by linkedservername.tablename, but i am not sure how to do for oracle.
From the example below customers and vendors are 2 oracle tables. Please correct the below syntax


SELECT C.VID,C.PID,C.BUSINESS_NAME,C.URL,C.ADDRESS1,C.ADDRESS2,C.CITY,C.STATE,C.COUNTRY_CODE,C.ZIP,V.ACCOUNT_MANAGER,C.SLA,
C.SIGNUP_DATE
FROM CUSTOMERS C WITH(NOLOCK) INNER JOIN  [van_mart].[VENDORS] V  
ON C.VID = V.VID
WHERE C.LAST_CHANGED >= @START_DATE AND C.LAST_CHANGED < @START_DATE+1 AND C.LAST_CHANGED < @END_DATE

Please let me know if you have any questions.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros