Home Forums SQL Server 7,2000 Working with Oracle create Linked Server to Oracle DB - Is this TSQL Script correct? - Novice RE: create Linked Server to Oracle DB - Is this TSQL Script correct? - Novice

  • i've edited my working oracle linked server connection with your info, so it seems to match how i've got mine set up:

    --#################################################################################################

    --Linked server Syntax for Oracle 10G

    --#################################################################################################

    DECLARE @server sysname,

    @srvproduct nvarchar(256),

    @provider nvarchar(256),

    @datasrc nvarchar(100),

    @location nvarchar(100),

    @provstr nvarchar(100),

    @catalog sysname,

    @sql varchar(1000)

    --add an access Database as a linked server

    SET @server = N'FinderFile14' --this is your ALias

    SET @srvproduct = N'Oracle'

    SET @provider = N'ORAOLEDB.Oracle' --optionally 'MSDAORA' to use the MS driver

    SET @datasrc = N'PLMKR5.DEN.EOGRESOURCES.COM' --this is the SID

    set @provstr = ''

    EXEC sp_addlinkedserver @server,@srvproduct,@provider,@datasrc,NULL,@provstr

    -- exec sp_dropserver AccessDb

    exec sp_addlinkedsrvlogin @rmtsrvname='FinderFile14',

    @useself = N'FALSE',

    @locallogin = 'sa',

    @rmtuser = N'CHANGE_ME',--oracle username

    @rmtpassword = 'NotARealOraclePassword' --oracle password

    /*

    exec sp_addlinkedsrvlogin @rmtsrvname='AccessDb',

    @useself='false',

    @rmtuser='Admin',

    @rmtpassword=''

    */

    --list all the tables and their names

    EXEC sp_tables_ex 'FinderFile14'

    GO

    EXEC dbo.sp_DropServer 'FinderFile14', 'DropLogins'

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!