Home Forums SQL Server 2008 Working with Oracle Anyway to connect to Oracle on the fly without tnsnames entry? RE: Anyway to connect to Oracle on the fly without tnsnames entry?

  • Here is what ended up working:

    SELECT *

    FROM OPENROWSET('OraOLEDB.Oracle'

    ,'server_ip_address:port_number/database'

    ;'your_user_name'

    ;'your_password'

    ,'your_query, for example, SELECT * FROM DB.SCHEMA.TABLE')

    In addition to this query, part of the solution required me to add a registry DWORD value for the OraOLEDB.Oracle provider. That registry value was DisallowAdHocAccess with a value of '0'. Without this registry addition non-SA logins received an error:

    Msg 7415, Level 16, State 1, Line 1

    Ad hoc access to OLE DB provider 'OraOLEDB.Oracle' has been denied. You must access this provider through a linked server.

    Once the registry was updated, everything works like a charm.

    Thanks!