Take the 2-minute tour ×

I am attempting to insert data across a DB link from an MS SQL Server 2008 into and Oracle 11g server using a pass through insert:

insert into openquery(ORACLE,'select varchar2_1,varchar2_2, number1 from table1')
   select varchar_1, varchar_2, integer_1 from mssql_table;

When I try and execute this I get and error saying that the data violates the schema.

The OLE DB provider "MSDAORA" for linked server "ORACLE" could not INSERT INTO table "[MSDAORA]" because of column "VARCHAR2_1". The data value violated the schema for the column.

I searched around google and stackoverflow but could not seem to find a specific solution to this problem. fyi: I cannot change the schema in the oracle DB.

Any help would be greatly appreciated.

share|improve this question

1 Answer 1

Check the lengths of the data in varchar_2. Can the data fit into the oracle column varchar2_1?

share|improve this answer
Yes.I am inserting a 3 letter string [ie 'ABC'] into a varchar2(100). EDIT: I have tried padding the string out to 100 chars and I have tried casting it as a char(100) and varchar(100) and no luck either time. –  Phil Vollhardt Nov 10 '10 at 20:52

Your Answer


