SQL Server linked server to Oracle

We have a SQL Server instance with a linked server to Oracle 9i.  When doing a select * (from Oracle) into some_table everything works as expected.
There is a project to move the SQL Instance to a new clustered server.  We confirmed that the OS, SQL and Oracle Driver versions are the same.  The problem is that when we run the exact same statement the table is being created with unicode columns.
For Example:
Oracle
Col1 Varchar2(20),
Col2 Varchar2(100)
Select into on current SQL Instance creates
Col1 Varchar(20),
Col2 Varchar(100)
Select into on new SQL Instance creates
Col1 NVarchar(20),
Col2 NVarchar(100)
Any help to identify how to resolve this issue?
Thank You,
Michael

Hi Michael,
The varchar2 data type in Oracle database and nvarchar data type in SQL Server is mapped to DT_WSTR data type in SSIS, while the varchar data type in SQL Server is mapped to DT_STR in SSIS. In your case, when loading the Oracle data to nvarchar columns SQL
Server table, you can extract Oracle data using a source adapter and directly load the data to the SQL Server table. When loading the Oracle data to varchar columns SQL Server table, you need to convert the DT_WSTR data type columns to DT_STR data type columns
before inserting into SQL Server table. To do the data conversion, you can use a Data Conversion Transform.
If you want to do it by using T-SQL rather than SSIS, please ask a new question in the T-SQL forum where you can get dedicated support.
Regards,
Mike Yin
If you have any feedback on our support, please click
here
Mike Yin
TechNet Community Support

Similar Messages

  • SQL 2005 Linked server to Oracle append

    Hi Oracle Exprets,
    i am using an SQl 2005 linked server too pull data from specific table in Oracle data base.
    the thing is i have to pull data daily and append this data to the exsisting table.
    here is my code :
    EXEC sp_tables_ex @table_server ='LINKED_ORA',@table_schema='Myschema'
    INSERT INTO dbo.ARS20091
    SELECT * FROM OPENQUERY(LINKED_ORA,
    'SELECT
    TROUBLEID,
    CREATE_DATE,
    DATE ''1970-01-01'' + CREATE_DATE / 24 / 60 / 60
    CREATEDATE
    FROM CLIENT_TROUBLE
    WHERE CREATE_DATE between ''1230768001'' AND ''1239043005''');
    GO
    this code works but i have to change the date daily and do a complete insert in a new table.
    Is there a way to append data daily ?
    thanks

    Hi sanjay,
    but why sysdate is giving me the today's date and when i use getdate ...it does not give me anything..
    i am using openquery tooracle data base..usually i have to use Oracle command..
    Mo..

  • Ms sql server linked server with OraOLEDB.Oracle provider session handling

    Hi everyone!!
    Here's my situation:
    I have a MS SQL Server 2008 R2 with a linked server to Oracle via OraOLEDB.Oracle provider.
    I use a .net application to open a connection to my sql-server, execute a select that collects data through the linked-server-connection from the oracle database and after that I close to connection to the sql.
    It does work so far,
    but when I start my application, exit it proberly and start it again it seems that i get the same session as before (which is for some reasons very bad).
    Is that the right/normal behavior?
    Is there any way to avoid that?!
    How does the OraOLEDB.Oracle provider handle the sessions if used in/as a linked server?
    thanks and greetings,
    exoc
    Edited by: 944414 on Jul 4, 2012 5:43 AM

    Hii Rouann,
    Does the error occur when you call the stored procedure from SSIS package and map SSIS variables to the parameters in the stored procedure? Can you run the store procedure from SSMS properly? If you can run the stored procedure from SSMS, the issue seems
    to occur due to the date format mismatch between the SSIS variables and the parameters in the stored procedure.
    If you cannot run the stored procedure from SSMS as well, the issue should occur due to the incorrect data conversion within the store procedure itself as Tom mentioned.
    Regards,
    Mike Yin
    TechNet Community Support

  • SQL Server Link Server issue.

    Hi,
    I have setup a linked sql in SQL Server 2000 to connect to an Oracle 9i database. When I try to select from a table through the link server I get the following error message.
    Could not execute query against OLE DB provider 'OraOLEDB.Oracle'.
    OLE DB error trace [OLE/DB Provider 'OraOLEDB.Oracle' ICommandText::Execute returned 0x80040155].
    This is for a table without any nvarchar2 columns (I get a different error for tables containing those datatypes).
    Any ideas?
    Thanks
    Sanjay

    Ralph,
    1. Right-click on the linked server you created, select Properties from the popup menu.
    2. In Linked Server Properties dialog box, click Options... button under Provider Name dropdown combo.
    3. Check (or enable) "Allow InProcess" option.
    4. Click Apply button.
    5. Click Ok button.
    Sinclair

  • SQL 2000 linked server to MSDAORA returns "provider did not ...

    Hi, I have a linked server setup in SQL 2000 using "MS OLE DB Provider for Oracle" to connect to a Oracle 9.2 DB on another server.
    This works fine apart from when the Oracle database is being backed-up, in which case any query against it returns: -
    Step Error Source: Microsoft OLE DB Provider for SQL Server
    Step Error DescriptionLE DB provider 'MSDAORA' reported an error. The provider did not give any information about the error. (Microsoft OLE DB Provider for SQL Server (80040e14): OLE DB error trace [OLE/DB Provider 'MSDAORA' IDBInitialize::Initialize returned 0x80004005: The provider did not give any information about the error.].)
    This is OK when the backup is running but we could be missing important messages if the Oracle errors are not able to be passed back correctly.
    Any help would be much appreciated.
    Regards,
    Richard

    did you find any answers? I have encountered the same problem

  • SQL 2000 LINKED SERVER ERROR 7303 WITH SQL 2012 ON WINDOWS SERVER 2012 R2

    Hi all,
    I have a problem with SQL Server 2012 and a linked server for SQL 2000 database.
    System specification:
    Windows server 2012 64 bit
    SQL SERVER 2012 64 bit
    REMOTE SERVER SQL 2000 32 bit
    I've installed sql native client 32bit,create a SYSTEM DSN odbc connection with "SQL Server" driver named "MYSERVER".
    Create a linked server with the query below in SQL 2012:
    EXEC master.dbo.sp_addlinkedserver @server =N'MYSERVER', @srvproduct=N'MYSERVER', @provider=N'MSDASQL', @datasrc =N'MYSERVER', @location=N'System';
    EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'MySERVER',@useself=N'True',@locallogin=NULL,@rmtuser=NULL,@rmtpassword=NULL
    GO
    but when i browse the linked server i receved error 7303.

    You need 64-bit MSDASQL. It is the bitness of the server you are connecting from that matters. 64-bit executables cannot hook into 32-bit DLL.
    However, I suspect that you will not get things to work anyway. At least I have not seen anyone this far who has been able to set up a linked server from SQL 2012 to SQL 2000. I know that when I tried this, the following providers had this result:
    SQLNCLI11 - does not support connections to SQL 2000.
    SQLNCLI10 - failed with some obscure message that I don't recall.
    SQLNCLI - Don't recall that the problem was here.
    SQLOLEDB - SQLOLEDB is always replaced with the most recent version of SQLNCLI, so this fails because of lack of support.
    I don't think I got through all version of the ODBC drivers, though.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • SQL Server Linked Server Issues with MVC 5

    I have 2 linked servers
    Server A = MYOB  ( custom 32 it ODBC Driver ) 
    Server B = SQL Server 64 Bit.
    They link fine using windows authentication - and I can run the following no problem in SQL Management tools ( as part of a stored proc ) . 
    DECLARE @MaxID varchar(100)DECLARE @Query varchar(MAX)
    -- Insert Sales
    SELECT @MaxID = MAX(SaleID) FROM [r2hserver\SQLexpress].artoo.dbo.MYOB_Sales
    SELECT @Query = 'INSERT [r2hserver\SQLexpress].artoo.dbo.MYOB_Sales SELECT * FROM OpenQuery(MYOB,''SELECT * FROM Sales WHERE SaleID > ' + @MaxID + ''')'
    EXEC(@Query)
    The problem is: Whenever execute the stored procedure from within a MVC 5 Web App ( EF6 )  - I get :
    Unable to start a nested transaction for OLE DB provider "SQLNCLI11" for linked server "myserver/SQLexpress". 
    A nested transaction was required because the XACT_ABORT option was set to OFF.
    and if I set XACT_ABORT ON  - I get :  Microsoft Distributed Transaction Coordinator (MS DTC) has stopped this transaction.
    I cannot figure out how to make it run!  I have turned firewalls off  and tried many different config.
    Ideas?

    Hi Marty,
    Thank you for your question. 
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Regards,
    Charlie Liao
    TechNet Community Support

  • UCCX 8.5 Informix/SQL Server linked server question

    We have several custom (in-house) queries that were written against a UCCX 7.x installation (SQL Server). These queries were written using a variety of t-sql functions (DATEADD, DATEPART, GETDATE etc). When we migrate to UCCX8.5 (Informix) I'm assuming we will need to translate those t-sql functions to their equivalent Informix functions...is that a correct understanding?  Has anyone else faced a similar situation?  Any gotchas to share?
    Also would be interested to hear from anyone who defined a linked server in SQL Server to the new Informix database server....how did it go, any gotchas there?
    Thanks!!!

    Hi
    That's pretty much it - there are equivalent functions for most things, and the syntax (beyond the basic selects) is quiet different and there are some random restrictions on the structure of queries that I don't think applied in MS SQL. A good way to learn is:
    - Comparing the MSSQL and Informix equivalents of the standard UCCX procedures
    - The IBM 'boulder' website tends to show up on most searches on google for informix commands and has lots of info on syntax etc.
    I find Informix more difficult than SQL as it's less forgiving and you don't get decent tools to debug/verify syntax etc without paying out some money..
    I've never had a need to do a linked server.
    Regards
    Aaron

  • SQL 2012 Linked Server connection from SQL 2000

    Hi,
    Does anyone know if it's possible to create a linked server connection in SQL 2000 to a SQL 2012 instance?
    If so, which provider should I use?
    Many Thanks,
    Phil

    Hi Shanky,
    I'm afraid you misunderstood my Q. The above posts show how to create a linked server connection FROM SQL2012 --> SQL 2000.
    I'm trying to create a linked server connection FROM SQL 2000 --> SQL 2012.
    Does anyone know if it's possible?
    Many Thanks,
    Phil
    I guess you dont read posts patiently below link ,which i also posted in my first reply, has details about the same
    http://social.msdn.microsoft.com/Forums/en-US/2e02c603-e28d-49eb-b073-548c59732b5d/linked-server-from-sql2012-to-sql2000?forum=sqlsetupandupgrade
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Setting up OracleXE as SQL Server Linked server

    I have recently installed OracleXE locally following the standard installation instructions. On the same machine I also have a local instance of SQL Server. I want to set OracleXE as a linked server to the Instance of SQL Server.
    Can any provide me with some idiot guide instructions to follow.

    Assuming you have all the privileges to create and publish in Designer and webi?deski
    1) Create system DSN on the server and your machine (in case if you are developing on your system and exporting to server)
    2) In Designer, Create a Connection
    3) Design Universe
    4) Export universe
    5) Create a report (DeskI/ WebI) depending on your need.

  • How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?

    How could I create a "Linked Server" link from SQL Server 2008R2 64-Bit to Oracle Database 11.2 64-Bit?
    Let's say the SQL Server and Oracle Database are in the same Company Internet Network.
    I have the code, but I do not know how to use it. Such as what is System DSN Name? Where could I get it. What does it look like?
    Do I need to install any Oracle Client Software in order to link from SQL Server to Oracle? Or SQL Server has the built-in drivers installed already that I can directly create a Linked Server from SQL Server to Oracle?
    I need to know details. Thanks.
    USE master
    go
    EXEC sp_addlinkedserver
         @server  = '{Linked Server Name}'
        ,@srvproduct = '{System DSN Name}'
        ,@provider  = 'MSDASQL'
        ,@datasrc  = '{System DSN Name}'
    EXEC sp_addlinkedsrvlogin
         @rmtsrvname = '{Linked Server Name}'
        ,@useself  = 'False'
        ,@locallogin = NULL
        ,@rmtuser  = '{Oracle User Name}'
        ,@rmtpassword = '{Oracle User Password}'

    You need an OLE DB provider for Oracle. There is one that ships with Windows, but it only supports very old versions of Oracle. Oracle has an OLE DB provider that you can use. I don't know if it's part of Oracle Client or how it is bundled.
    You should not use MSDASQL or any DSN.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Migration of a database from sql server 2008 r2 to oracle 11 g

    We're trying to migrate a Sql server managment studio database to Oracle 11g using SQL Developer 4.0. We can successfully connect to both Sql server managment studion 8.0 and Oracle 11g using the tool, as well as click through the Migration Wizard and start the migration.
    This opens the Database Migration dialog box, which indicates the capture process starts normally. we get the following error:
    ora :01440 : can not insert null into migrlog (id column) ,
    \and then after some time , i get an error that migration failed
    I know , that we vcan nt insert null into migrlog table , then pls tell me how can  i resolve fro this problem  . is there any way to solve it,
    i am not getting the reason,I thing it may be due to reason that , I have table's column in my source db with more than 30 character.
    If i am migrating one by one table . then it is not giving any error, and identifier name is getting shrink in 30 character. but i am not getting the view , stored procedure , indexes , and others
    then what is the solution  for that, somebody pls suggest any help?????????????

    This forum is dealing with Oracle gateway connecting to a foreign database. When connecting with SQL Server LINKED Server mechanism to Oracle you're using the Oracle OLEDB driver and there's a separate thread that assist you with the Oracle OLEDB driver. Please close this thread and post your issue in this forum:
    Oracle Provider for OLE DB

  • Adding a table to a linked server in SQL

    Hi
    I have a linked server in SQL server management studio.
    It has a list of oracle tables that can be reached through it. To add tables to the list do i need set up some permissions on the Oracle side?
    thanks a lot for any help

    To add to what Sunny posted. If the linked server uses a fixed user/password to connect to Oracle then in the Oracle database all you need do is get the required object privileges granted to the Oracle username being used in the linked server to Oracle. The grant can be direct to the username or to a role the username has been granted.
    If the MS SQL Server Linked Server to Oracle does not use a fixed user then the SQL Server usernames have to also exist in Oracle or have been mapped via the linked server definition to an Oracle username. Different SQL Server users can have different Oracle usernames associated to them via the linked server definition so you may need the Oracle grants issued to one or more Oracle usernames.
    Most linked servers use fixed users to connect to Oracle but you need to be aware this is not always true and when it is not true the list of tables shown under the linked server can vary based on the SQL Server user logged in.
    HTH -- Mark D Powell --

  • Error in SP while inserting to Linked Server

    Hi all
            I am trying to execute a SP in  transaction notification to insert values from OHEM(Employee Master Data) table to a table at Linked server. while doing so it works when executed at SQL Sever but it triggers the following error inside SAP.
    "[Microsoft][SQL Server Native Client 10.0][SQL Server]The operation could not be performed because OLE DB
    provider "MSDASQL" for linked server "LINKED SERVER NAME" was unable to begin a distributed transaction. (CINF)"
    please help me to solve this issue..
    Regards
    Naresh Kumar

    HI
    INSERT INTO OPENQUERY (TER, 'SELECT emp_code,emp_firstname,emp_lastname,
    emp_department,emp_designation,emp_category
    emp_mobilenumber,emp_emailid,emp_reportingto,emp_status
    FROM expense_report.site_employee_master')
    Select employeecode,firstname,lastname,Department,Designation,mobile,EmailID,ReportingTO,Status
    from SBO_BATPL.dbo.EMR_EMPLOYEEMASTER E0 where EmployeeCode='@empcode'
    this is my query and i use SAP 8.81 Pl:8
    regards
    Naresh.K
    Edited by: nareshcse09 on Dec 26, 2011 12:36 PM

  • Tune Linked Server

    Dear Experts,
    Could you please list out possible things for performance tuning of SQL server linked server.
    Thanks in advance

    If you are asking about tuning the Linked server queries, then the below are my best picks:
    Linchi Shea
    BRAD MCGEHEE

Maybe you are looking for

  • Adding Chapters and Menus to  VTS Folder?

    Hello I have a DVD that was copied from a VHS tape. Its a concert video without menus or chapter breaks. I want to have each song be a chapter so how do I break it up? I don't even know what software to use...I have DVD Studio Pro 3 and Final Cut Pro

  • Backup file too small?

    I did a complete new backup onto a 1Tb TC I had previously used for backup (but deleted the old bakcup file). I have 214 GB on my HD, and TM said it was backing up about 214 GB, but it stopped at about 175 GB and said it was done! No further incremen

  • Vb 6 issue

    Please sorry if am not posting at the correct forum, please am doing my project and i need some help in vb6 i need sql statement that will list all product that will expire within 60days based on their expiring date. this is my code, kindl help me Ad

  • Export Import Help Needed

    Hi, I have a situation where i have to export data/tables from Oracle 7.3.4.4.0 and import into Oracle 8.1.7.4.0. Is it possible to export data from a lower version and import into higher version? I have never worked on Oracle 7 and Oracle 8. Any kin

  • I have .mac and iCloud accounts on my ipad

    Do I really need both on my iPad.  If not, which should be deleted?