On Lies & Linked Server

time to read 3 min | 536 words

I'm not sure who is at fault here, but Oracle as a linked server really sucks. I'm not talking about general Oracle stuff here (I'll try to post something about it later). I'm talking about the database lying about data types that it doesn't like.

For instance, take the following Oracle table defination:

CREATE TABLE Foo
(

   Bar Number

)

If you try to access it from a SQL Server Linked Server, like this:

SELECT

      Bar

FROM LinkedSrv..ADMIN.FOO

What do you think the type of Bar will be?

No, it's not numeric, it is NVARCHAR(384), I got bitten by this stuff a couple of time, and it's Not Nice to do to an unsuspecting programmer.