Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I need a query that retrieves info from an Oracle table and
a query that retrieves info from a SQL Server table. The
info has to be joined together according to Record ID
numbers. I have very limited access to the Oracle database
but full control of the SQL Server database.How do I join
two different queries from two different databases?

Answer Posted / guest

To query to different data sources, you can make the Oracle
server a linked server to the SQL Server server. A linked
server can be any OLE DB data source and SQL Server
currently supports the OLE DB data provider for Oracle. You
can add a linked server by calling sp_AddLinkedServer and
query information about linked servers with sp_LinkedServers.

An easier way to add a linked server is to use Enterprise
Manager. Add the server through the Linked Servers icon in
the Security node. Once a server is linked, you can query it
using a distributed query (you have to specify the full name).

Here's an example of a distributed query (from the SQL
Server Books Online) that queries the Employees table in SQL
Server and the Orders table from Oracle:

SELECT emp.EmloyeeID, ord.OrderID, ord.Discount
FROM SQLServer1.Northwind.dbo.Employees AS emp,
OracleSvr.Catalog1.SchemaX.Orders AS ord
WHERE ord.EmployeeID = emp.EmployeeID
AND ord.Discount > 0

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the return type of executeupdate ()?

857


What is use of attribute hierarchy ordered ? : sql server analysis services, ssas

960


The external application that is executed in one of the tasks does not have a log file, but only a screen log. How can I save the data from the screen? : sql server management studio

954


what exactly sql injuction.how to overcome.....

2484


what is a default tcp/ip socket assigned for sql server? : Sql server database administration

1002


Explain the truncate command? : SQL Server Architecture

1092


What is difference between views and stored procedures?

927


Using the customer, and order table in northwind database, please write a query to produce xml?

1007


Explain about SQL server 2005?

918


What is sql view?

954


What are the differences between lost updates and uncommitted dependencies?

1012


Explain logical operators in sql server?

1031


What does it mean to normalize a database and why would you do it?

937


What is the syntax for encrypting a column in SQL Server?

1054


what is the system function to get the current user's user id? : Sql server database administration

953