Create connection from MS SQL to Oracle (linked server/db link)

6 May

In order to select from MS SQL to a Oracle database, we had to do the following:

  1. Create linked servers in the database
    • EXEC sp_addlinkedserver 
         @server = N'oracledb', 
         @srvproduct = N'',
         @provider = N'MSDASQL', 
         @datasrc = N'oracledb';
      GO
    • server objects – linked servers – new linked servers
      
      
  2. User openquery like e.g
    • select * from openquery(oracledb,’select sysdate from dual’)
    • go

 

Read more:

http://wiki.servicenow.com/index.php?title=Using_ODBC_Driver_in_SQL_Server_2008_and_2012

http://technet.microsoft.com/en-us/library/aa276848(v=sql.80).aspx

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: