A blog to help me remember what in the hell i've done and what not to do again. ever. Maybe you'll learn from my mistakes or epiphanies.
Blog topics include SQL, T-SQL, Google, Windows, Visual Basic, Python, C#, etc.
Wednesday, July 27, 2011
Query Oracle from SQL Server w/o a permanent Linked Server entry
Need to query a table on an Oracle box from SQL Server?
If your DBA won't let you create a linked server, this option may work for you. You'll need hard code your credentials in :(.
SELECT *
FROM OPENROWSET('MSDAORA',
'DATABASE_NAME';
'USER_TO_CONNECT_AS';'USER_PASS', 'select * from dual')
AS test
You would think a DBA would prefer creating a Linked-server over standardizing hard-coding credentials into dynamic queries.
ReplyDeleteA smart DBA yes.
ReplyDelete