May 7, 2005 at 2:27 pm
Hi,
I would like to connect to oracle database from sql server 2000 database. Could any body please help me out how to connect to oracle database?. I have to update one table in oracle database based on some values in the sql database table.
I was thinking of writing a trigger on the table in sql database which will update the table in the oracle database.But how do I connect to the oracle database from the sql database trigger? Is this possible ?
Thanks in advance.
Kavita
May 9, 2005 at 5:56 am
I don't believe I'd use a trigger for this because if the Oracle DB or the connection to it is down, then your SQL Server processes will start kicking off errors.
I would use a trigger to write the info to a staging table and periodically run a job or batch to transfer the data from the staging table to the Oracle database.
In either case, one way to do this is to setup a "Linked Server" to the Oracle database on the SQL Server. This info is in Books OnLine but here's a start...
By script...
This example creates a linked server named LONDON Mktg that uses the Microsoft OLE DB Provider for Oracle and assumes that the SQL*Net alias for the Oracle database is MyServer.
USE masterGO-- To use named parameters:EXEC sp_addlinkedserver @server = 'LONDON Mktg', @srvproduct = 'Oracle', @provider = 'MSDAORA', @datasrc = 'MyServer'
By Enterprise Manager...
To set up a linked server
- Expand a server group, and then expand a server.
- Expand Security, right-click Linked Servers, and then click New Linked Server.
- Click the General tab, and in the Linked server box, type the name of the server to link.
- Under Server type, click a selection.
If you select Other data source, you will have to specify provider properties.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply