Microsoft SQL Server Using Linked Server Converts VARCHAR2 Column to NVARCHAR (Doc ID 1362570.1)

Last updated on JULY 05, 2017

Applies to:

Oracle Provider for OLE DB - Version: 10.2.0.4 to 11.2.0.2 - Release: 10.2 to 11.2
Information in this document applies to any platform.
Microsoft SQL Server 2008 R2

Symptoms

Microsoft SQL Server Management Studio (SSMS) connects to an Oracle datasource via a Linked Server (OraOLEDB).
When creating a view using the following command in SSMS:

CREATE VIEW emptest AS
SELECT ename
FROM
OPENQUERY(orcl,
'SELECT ENAME
FROM EMP'); 

The view shows an NVARCHAR instead of VARCHAR datatype.

The Oracle database characterset is Unicode (UTF8, AL32UTF8)
Can be seen by :
  SELECT * FROM NLS_DATABASE_PARAMETERS

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms