Microsoft Developer Network > 포럼 홈 > SQL Server Data Access > Openrowset to Oracle doesnt work after upgrading to SQL Server 2005
질문하기질문하기
 

질문Openrowset to Oracle doesnt work after upgrading to SQL Server 2005

  • 2007년 6월 28일 목요일 오전 11:33Araki66 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi,

     

    I just upgraded to SQL server 2005 and some of my Openrowset to Oracle doesnt work. I found out that the issue occur with field with structure Numeric.

    The issue is not solve even when I try to cast the field to varchar. sometimes it succeeded and sometimes I get error 7320 & 7321.

    I'm using Oracle connector from SQL to Oracle.

    I've 64 bit SQL Server.

    Attach the code, the Numeric field is SCORE.

     

    select *

    FROM

    OPENROWSET('ORAOLEDB.ORACLE',aaaa;bbbb;cccc,

    'SELECT AUDIT_OPRID, AUDIT_STAMP, AUDIT_ACTN,EMPLID, ACCOMPLISHMENT, MAJOR_CODE,

    CAST(SCORE AS Varchar(250))

    FROM SYSADM.PS_RTA_ACCOMPLISHM WHERE 1=2')

     

    Anyone can advice on resolution?

     

    Thanks,

    Assaf

모든 응답

  • 2007년 6월 29일 금요일 오전 6:55Anton Klimov - MSFT중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Do I understand you correctly that you used to have SQL Server 2000 and the same query worked?

    It also might be useful if you could provide the full text of the messages you are getting.
  • 2007년 6월 29일 금요일 오후 4:05Jens K. Suessmeyer -MSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     


    Sql Server 2005 is locked down by default.

    Go to Program > Microsoft SQL Server 2005 > Configuration Tools > Surface Area Configuration > Surface Area Configuration  for features > AdHoc Remote Queries > Enable OPENROWSET AND OPENDATASOURCE support.

    Jens K. Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---


  • 2007년 6월 30일 토요일 오후 5:49Araki66 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Hi Guys,

     

    The openrowset is enabled. It was working in 2000 and not working in 2005

    Its working for other tables without fields with Numeric.

     

    here some errors i get

     

    OLE DB provider "ORAOLEDB.ORACLE" for linked server "(null)" returned message "ORA-00910: specified length too long for its datatype".

    Msg 7321, Level 16, State 2, Line 1

    An error occurred while preparing the query "SELECT AUDIT_OPRID, AUDIT_STAMP, AUDIT_ACTN,EMPLID, ACCOMPLISHMENT, DT_ISSUED, MAJOR_CODE,

    CAST(SCORE AS VARCHAR(8000))

    FROM SYSADM.PS_RTA_ACCOMPLISHM WHERE 1=2" for execution against OLE DB provider "ORAOLEDB.ORACLE" for linked server "(null)".

     

    Msg 7320, Level 16, State 2, Line 2

    Cannot execute the query "SELECT AUDIT_OPRID, AUDIT_STAMP, AUDIT_ACTN,EMPLID, ACCOMPLISHMENT, MAJOR_CODE,

    CAST(SCORE AS numeric(38,2))

    FROM SYSADM.PS_RTA_ACCOMPLISHM WHERE 1=2" against OLE DB provider "ORAOLEDB.ORACLE" for linked server "(null)".

     

    Thanks,

    Assaf

  • 2007년 7월 3일 화요일 오후 9:20Jens K. Suessmeyer -MSFT, 중재자사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    WHats the range of the data ? Is there any data which has a precision of 38 ?

    Jens K. Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---
  • 2007년 7월 5일 목요일 오후 8:14Araki66 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     

    Yes,

     

    There are Numeric(38,0)

    There are Numeric (7,2)

     

    What the relation between one data type to the import of other fields in the table?

    Do I need to do cast and to what type?

     

    Assaf