Problem using odbc driver 10g with SQL Server 2005

We are getting following error. Any solution?
cannot retrieve the column codepage info from the OLE DB provider

there is an additional error message
The output column SR_CONTACT_POINT_ID (58) has a precision which is not valid. Precision must be between 1 and 38.

Similar Messages

  • Using SQLBindParameter, SQLPrepare and SQLExecute to insert a Decimal(5,3) type fails with SQLSTATE: 22003 using ODBC Driver 11 for SQL Server

    Hello everyone.
    I'm using SQL Server 2014, and writting on some C++ app to query and modify the database. I use the ODBC API.
    I'm stuck on inserting an SQL_NUMERIC_STRUCT value into the database, if the corresponding database-column has a scale set.
    For test-purposes: I have a Table named 'decTable' that has a column 'id' (integer) and a column 'dec' (decimal(5,3))
    In the code I basically do:
    1. Connect to the DB, get the handles, etc.
    2. Use SQLBindParameter to bind a SQL_NUMERIC_STRUCT to a query with parameter markers. Note that I do include the information about precision and scale, something like: SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_NUMERIC, SQL_NUMERIC, 5, 3, &numStr,
    sizeof(cbNum), &cbNum);
    3. Prepare a Statement to insert values, something like: SQLPrepare(hstmt, L"INSERT INTO decTable (id, dec) values(?, ?)", SQL_NTS);
    4. Set some valid data on the SQL_NUMERIC_STRUCT
    5. Call SQLExecute to execute. But now I get the error:
    SQLSTATE: 22003; nativeErr: 0 Msg: [Microsoft][ODBC Driver 11 for SQL Server]Numeric value out of range
    I dont get it what I am doing wrong. The same code works fine against IBM DB2 and MySql. I also have no problems reading a SQL_NUMERIC_STRUCT using SQLBindCol(..) and the various SQLSetDescField to define the scale and precision.
    Is there a problem in the ODBC Driver of the SQL Server 2014?
    For completeness, here is a working c++ example:
    // InsertNumTest.cpp
    // create database using:
    create a table decTable with an id and a decimal(5,3) column:
    CREATE TABLE[dbo].[decTable](
    [id][int] NOT NULL,
    [dec][decimal](5, 3) NULL,
    [id] ASC
    // Then create an odbc DSN entry that can be used:
    #define DSN L"exOdbc_SqlServer_2014"
    #define USER L"exodbc"
    #define PASS L"testexodbc"
    // system
    #include <iostream>
    #include <tchar.h>
    #include <windows.h>
    // odbc-things
    #include <sql.h>
    #include <sqlext.h>
    #include <sqlucode.h>
    void printErrors(SQLSMALLINT handleType, SQLHANDLE h)
        SQLSMALLINT recNr = 1;
        SQLSMALLINT cb = 0;
        SQLWCHAR sqlState[5 + 1];
        SQLINTEGER nativeErr;
        while (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)
            msg[0] = 0;
            ret = SQLGetDiagRec(handleType, h, recNr, sqlState, &nativeErr, msg, SQL_MAX_MESSAGE_LENGTH + 1, &cb);
            if (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO)
                std::wcout << L"SQLSTATE: " << sqlState << L"; nativeErr: " << nativeErr << L" Msg: " << msg << std::endl;
    void printErrorsAndAbort(SQLSMALLINT handleType, SQLHANDLE h)
        printErrors(handleType, h);
    int _tmain(int argc, _TCHAR* argv[])
        SQLHENV henv = SQL_NULL_HENV;
        SQLHDBC hdbc = SQL_NULL_HDBC;
        SQLHSTMT hstmt = SQL_NULL_HSTMT;
        SQLHDESC hdesc = SQL_NULL_HDESC;
        SQLRETURN ret = 0;
        // Connect to DB
        ret = SQLAllocHandle(SQL_HANDLE_ENV, NULL, &henv);
        ret = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);
        ret = SQLConnect(hdbc, (SQLWCHAR*)DSN, SQL_NTS, USER, SQL_NTS, PASS, SQL_NTS);
        if (!SQL_SUCCEEDED(ret))
            printErrors(SQL_HANDLE_DBC, hdbc);
            return -1;
        ret = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
        // Bind id as parameter
        SQLINTEGER id = 0;
        SQLINTEGER cbId = 0;
        ret = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 0, 0, &id, sizeof(id), &cbId);
        if (!SQL_SUCCEEDED(ret))
            printErrorsAndAbort(SQL_HANDLE_STMT, hstmt);
        // Bind numStr as Insert-parameter
        SQL_NUMERIC_STRUCT numStr;
        ZeroMemory(&numStr, sizeof(numStr));
        SQLINTEGER cbNum = 0;
        ret = SQLBindParameter(hstmt, 2, SQL_PARAM_INPUT, SQL_C_NUMERIC, SQL_NUMERIC, 5, 3, &numStr, sizeof(cbNum), &cbNum);
        if (!SQL_SUCCEEDED(ret))
            printErrorsAndAbort(SQL_HANDLE_STMT, hstmt);
        // Prepare statement
        ret = SQLPrepare(hstmt, L"INSERT INTO decTable (id, dec) values(?, ?)", SQL_NTS);
        if (!SQL_SUCCEEDED(ret))
            printErrorsAndAbort(SQL_HANDLE_STMT, hstmt);
        // Set some data and execute
        id = 1;
        SQLINTEGER iVal = 12345;
        memcpy(numStr.val, &iVal, sizeof(iVal));
        numStr.precision = 5;
        numStr.scale = 3;
        numStr.sign = 1;
        ret = SQLExecute(hstmt);
        if (!SQL_SUCCEEDED(ret))
            printErrorsAndAbort(SQL_HANDLE_STMT, hstmt);
        return 0;

    This post might help:
    If this is no solution try increasing the decimale number on the SQL server table, if you stille have the same problem after that change the column to a nvarchar and see the actual value that is put through the ODBC connector for SQL.

  • How do you compare Oracle 10G with SQL Server 2005?

    exept for performance and pricing...
    We haven't decide to upgrade SQL Server 2000 to SQL Server 2005 or buy more license for Oracle 10G...
    Any comments are welcome!

    OK I only came here because of APC's referral down the piece (I was curious where all the hits came from - cheers Andrew). Comments embedded anyway
    Thanks Gaff!
    * Staff Experience with product - how flexible is
    your staff?
    --Staff need to learn sth. new...:)That's a fair motivation if recruitment and retention of staff is an issue - if you want reliability giving business systems to people who don't know the tech is a rather foolish move.
    * Current product use Corporation/group - if you have
    15 SQL Server boxes and no Oracle, what is the
    impetus for change? Same if you have 15 Oracle boxes
    and no SQL Server ones.
    --80% SQL server and 20% Oracle. We are thinking to
    balance to 50%-50%.I'm curious as to the reasoning behind this? I don't really see what the benefit is.
    * Features - Do you want/need text handling
    capabilities? Data mining? Storage of non-text
    records? XML?
    --I think both of DB system can do these.They can
    * Scalability - Is one Windows box going to meet your
    needs or do you need to scale (now or eventually) to
    multiple boxes of multiple CPUs?
    --This is really a benefit feature of Oracle better
    than SQL Server.SQLServer scales - it just scales in a different way (federated databases vs RAC).
    Thank u for ur US$.02Are you evaluating the platform for an in-house development or a database neutral application - if the latter I'd be sorely tempted to find out what the development platform is or read the docs for clues. For example we are looking at a product that supports SQLServer,MSDE and Oracle. In the FAQ "how do I choose between SQLServer and MSDE?", if we do implement it will be on an MS platform.
    I consider this probably the most crucial factor since SQLServer and Oracle have different architectural features they tend to generate different development approaches - porting one to the other nearly always hurts the new platform. Plus if I need support I'd be hoping that I got a bug fix from a developer and not from a developer whose fix was then ported.
    The same applies to in-house dev obviously, but there at least you can hire people with the right skillset for the app development.
    Niall Litchfield
    Oracle DBA

  • Purchase or not ODBC Driver for MS SQL Server 2005

    Hi experts,
    We have Windows Server 2003 R2 Standard with MS SQL SERVER 2005 and our other branch want to access this system's Database at their end.
    other branch is planning to integrate database record to ERP
    Can u confirm whether they have to purchase ODBC driver or not.
    from where i can purchase ODBC driver online.
    Best Regards,

    The data provider like ODBC and SQL Server Native Client are already integrated in all common MS Windows OS, so in common you don't need to install additional provider.
    But if you want to install and newer version, then you can get it for free from
    Feature Pack for Microsoft SQL Server 2005 SP4 => sqlncli.msi ( = SQL Native Client, which includes ODBC)
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Crystal Report 8.5 with SQL SERVER 2005 problems

    Post Author: AREVA
    CA Forum: Data Connectivity and SQL
    Hi All !We have some problems with Crystal Reports version 8.5 with SQL Server 2005: 1) When we want to generate a report (using data in SQL Server 2005) we have a popup message error : "impossible to loaded pdssql.dll".2) If we want to use SQL Server 2005, which Crystal Reports version we must used ? Is there any restrictions with this connectivity with 8.5 version ?Please, let me known, all informations about SQL Server 2005 and Crystal Report 8.5.Thanks for all !Best regards Anthony

    Hello Kamlesh,
    There is no expectation that the ActiveX viewer (RDC?) from CR8.5 will work in any version of Visual Studio .NET. There is also no expectation that the ActiveX viewer from CR8.5 will work on a machine with a 64 bit operating system.
    You're using VS2008. You should migrate to the bundled edition of CR for VS2008 (v10.5), the ReportDocument object, and the .NET Windows form viewer or Web form viewer.
    Dan Kelleher

  • Oracle 10g to sql server 2005 - how to setup

    I have been searching on how to setup a connection from oracle 10g to sql server 2005 and i have to admit i am struggling a bit.
    I have read about Heterogeneous Services and Database Gateway but we really dont want to fork for licence fees so it looks like i have to investigate HS.
    My environment is:
    10gR2 Linux 32 bit
    SQL Server 2005 32bit.
    Would someone be able to provide me with a list of steps to help me get this setup?

    If you don't want to pay for any licence fees then you will have to use the 11g Database Gateway for ODBC (DG4ODBC) which is included in your RDBMS license.
    You need to use the 11g versions because all previous gateway versions have been desupported for some time. The latest version is which can be downloaded from My Oracle Support as -
    and download -
    - this is the Gateway media pack and has everything needed for a standalone gateway install.
    This version is certified the following RDBMS versions - + RDBMS patch 5965763, + RDBMS patch 5965763,,, all 11.1 versions, all 11.2 versions.
    You have 2 choices about where you can install it and it would be better to install the gateway into a new and separate ORACLE_HOME from any existing Oracle installs -
    1. On the Linux 32-bit platform where the RDBMS is running. If you install it here you will need to supply a third party ODBC driver. The only free one I am aware of is from FreeTDS but there may be others. There can be problems with the FreeTDS so another one may be preferable but these usually require a license fee.
    See this note in My Oracle Support -
    How to Configure DG4ODBC on Linux x86 32bit or on HP-UX RISC (DG4ODBC 11.1 only) to Connect to Non-Oracle Databases post install (Doc ID 466228.1)
    2. Install DG4ODBC on the Windows platform where SQL*Server is running. If you install on Windows then you will be able to use the Microsoft SQL*Server ODBC driver which should already be installed. See this note on My Oracle Support -
    How to Setup DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit (Doc ID 466225.1)
    If you don't have access to My Oracle Support you will need to contact someone in your organisation to access the notes for you or review the gateway documentation -

  • ODI with SQL Server 2005

    Good afternoon,
    We recently installed, in a Windows environment with SQL Server 2005 and Hyperion Essbase/Planning/HFM 11.1.1. We were following John Goodwin's infamous blog (thanks, John!), but ran into a number of snags.
    For instance, when we set-up interfaces with flat files as the source, loading metadata either to Planning or Essbase, ODI errors out when:
    1) our header name in the flat file has spaces (using double quotes didn't work)
    2) our header name in the flat file is different than the reverse property name from Essbase/Planning.
    Also, we're now seeing an issue in our Flat file to Essbase metadata interface where the SQL used in the IKM seems to be incorrect. Below is the error message we're receiving:
    "org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 20, in ? An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements,
    look for empty alias names. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name."
    We are thinking that the culprit may be either the wrong .jar or .jre we're using with SQL Server 2005, as there seem to be inherent issues with the SQL generated in the LKM and IKM. Our questions to you:
    1. What sqljdbc.jar driver version are you using?
    2. What .jre version are you using?
    3. What environment does the above work correctly in? (perhaps an earlier version of ODI against an earlier version of Hyperion?)
    FYI - We have tried sqljdbc 1.0 and 2.0, with .jre 1.6.0_10.
    Thanks in advance!
    Edited by: Alapat on Jan 22, 2009 8:04 AM

    Thank you very much for responding!
    After a 2 week battle, we are now finally coming to a close on our issues (although we cannot say for sure what all of the causes were).
    Here is what we discovered about our questions, through other threads:
    1. John Goodwin was using JRE 1.6.x, so we ruled that out as a culprit.
    2. Others are using SQL Server 2005 just fine with ODI, so we ruled this out too. We chose to keep the sqljdbc 2.0 driver.
    Here are some issues we did uncover during our investigation:
    1. We were having issues with our agent, specifically regarding the HFM technology. We created a new one, added a few extra parameters, compiled the agent, and are now back up and running. We realized the problem when we switched to "Local (No Agent)" and saw that we were not having as many issues.
    2. We went into the physical agent and pressed "Update Scheduling". We do not know if this had any effect, but we suddenly noticed that our flat file header issues were resolved.
    3. The Essbase issue was due to a configuration error with our Hyperion Essbase physical technology. We went into that technology and changed a setting on the "Languages" tab, called "Object Delimiter". It had double-quotes in it - we removed that parameter and instantly saw a change in the SQL being executed.
    4. Some of the mappings in our interfaces needed to be executed on different environments. i.e. - We needed to switch to "staging" when the flat file header was different than the target column name. Newbie mistake - we thought ODI had built-in intelligence to choose correctly for us.
    5. When doing a reverse on Essbase models, we noticed that the Essbase columns would populate with an "Undefined" datatype, instead of the expected CHAR. We have to manually define all column datatypes after every Essbase reverse now. Must be a bug.
    6. We also noticed when doing a flat file reverse that all columns auto-populate with datatype STRING, length 50. We have to manually personalize that option for different Hyperion applications, based on need. i.e. - some require numeric datatypes, or smaller/larger lengths. This was obviously a newbie error. :)
    Thank you for your tip on the MS SS2005 JDBC drivers - we will look into your other options - IMHO, JTDS, etc.

  • Am failing to install Java IDM in a Windows XP machine with SQL Server 2005

    I am new to Java IDM . I had downloaded IDM 7.0 and trying to install. But i am failing to install Java IDM in a Windows XP machine with SQL Server 2005.
    I used .,
    JDK 1.5
    Tomcat 6.0
    Microsoft SQL Server 2005
    Microsoft SQL Server 2005 JDBC driver
    I got the following error while trying to connect the waveset database with Repository type as SQL Server 2005(JDBC Driver)
    ==> Login failed for user 'waveset'. The user is not associated with a trusted SQL Server connection.
    what name i can specify in JDBC ... is there any need to create DSN for that ...........
    The Parameters that I have given for connection are:
    URL: jdbc:sqlserver :1433;DatabaseName=
    JDBC Driver:
    Connect as User:
    Connect Password:

    Do you have your SQL server set to Windows Authentication mode only?
    You should change it to allow mixed authentication. You can do this in SQL Server Management Studio under Server Properties -> Security.

  • How can I connect NetBeans 6.1 with SQL Server 2005?

    Hello guys...
    how can i connect NetBeans 6.1 with SQL Server 2005?
    there is no SQL Server in Server list when we create a new Web Project and choose Server.
    I'm new to NetBeans and this is my first time of posting.
    If has some errors and unwanted disturbing,pls understand me. Thanks.
    (If you have references or some snippets, i'll be glad if u can share.)

    The JDBC-ODBC bridge wasn't recognizing any of the primary keys I had set up in SQL Server. After lots of head banging, here's the solution I came up with:
    1. Download the appropriate driver. SQL Server 2000 requires the SQL Server 2000 JDBC driver (
    SQL Server 2005 download: (
    3. After installing, right-click on "Libraries" in your project, and choose "Add Library...". Next, give it a name (i.e. SQLServer2000), and select "Class Libraries".
    4. On the next screen, find the JAR files (should be in C:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\), and add them under the "Classpath" tab. It will now be available under "Libraries" for future projects.
    5. You can now create a connection to a specific database under the "Services" tab (next to "Projects" and "Files" in the top left of the screen). Select "Microsoft Sql Server 2000 (Microsoft Driver)" and format the "Database URL" like this:
    1433 is the default port, though your DBA may have changed it.
    I posted a simpler version of this on the FAQ page - they had the following title with no content on the answer page:
    "Cannot Select Tables From MsSql 2000 Because It Says No Primary Key Next To Each Table But The Tables DO Have A Primary Key. What Do I Do?"

  • Error While Installing IDES ECC6 with SQL Server 2005

    Dear Experts,
    I found an error while installing IDES ECC6 with SQL Server 2005. The error is raising at the stage of 17 of 24 processing the procedure of 195 of 197 (sap_z_set_permissions).
    I have tried several times by configuring different type of activites but still i am facing the same problem at the same stage. Please help me in thig regard.
    I herewith pasted hereunder log files information
    ERROR 2008-01-17 18:38:47
    FCO-00011  The step ExeProcs with step key |NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_Postload|ind|ind|ind|ind|10|0|NW_Postload_MSS|ind|ind|ind|ind|2|0|MssProcs|ind|ind|ind|ind|1|0|ExeProcs was executed with status ERROR .
    INFO 2008-01-17 18:40:05
    An error occured and the user decide to stop.\n Current step "|NW_Onehost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CreateDBandLoad|ind|ind|ind|ind|10|0|NW_Postload|ind|ind|ind|ind|10|0|NW_Postload_MSS|ind|ind|ind|ind|2|0|MssProcs|ind|ind|ind|ind|1|0|ExeProcs".
    ERROR 2008-01-17 18:38:47
    MDB-05053  Errors when executing sql command: <p nr="0"/> If this message is displayed as a warning - it can be ignored. If this is an error - call your SAP support.

    Occasionally, mid-way through the upgrade, DB permissions to users might change. Check to see, if the users SAP<SID>, OPS$ users have the DBA privilege. Re-assign the role and try continuing with the upgrade.

  • DESKI Report using Temp tables in MS- SQL server 2005

    I am trying to create a Free hand SQL DESKI report using temp tables in MS SQL Server-2005, I am using ODBC connection.
    When I run the report, I am getting the error
    u201CConnection or SQL sentence error (DA0005) No column or data to fetchu201D
    Select *
    into #t1
    from region
    select * from #t1
    drop table #t1
    Please help.

    Pratik, the SQL does not seem right. BTW you can only retreive data via Deski Free hand SQL. Also try to use OLE DB connection.

  • Open (.sdf) file with SQL server 2005 Management Studio

    In VS2005, I have created a SQL Mobile database, (.sdf).
    Copied that (.sdf) file to Desktop, and when I try to open with SQL Server 2005 management studio, its showing error "make sure the application for the file type (.sdf) is installed."
    How can I open this file with SQL server?

    You must install SP2 if using Management Studio Express ( Ejlskov Jensen, MCTS: WM App, MCITP: SQL 2008 Dev -
    Please mark as answer, if this was it.

  • TopLink with SQL Server 2005

    Could someone help answer this question:
    Has TopLink 10.1.3.x been certified to support SQL Server 2005?
    I appreciate your information.

    It is certified on SQL Server 2000.
    I know some customers are using it with SQL Server 2005, though.

  • Integrate Oracle IDM with Sql Server 2005

    Hi Guys,
    We maintain the employees information in Oracle IDM and we want to integrate Oracle IDM with Sql server 2005.
    how we can this.

    The DB connector?
    The version supports SQL server 2005.
    The latest version of the GTC db connector might also work.
    Best regards

  • EPM 11 Configuration with SQL Server 2005

    I am having a terrible time trying to get the EPM System Configurer to communicate with SQL Server 2005 Evalution. I keep getting the error "Cannot open database "server" requested by the login. The login failed." I have the windows firewall turned off. The protocol TCPIP is turned on and other protocal are turned off. Any suggestions. Thanks in advance.

    As John mentioned it is supposed to be supported in a future release. That version would be 11.2 -- there will be a version coming out before 11.2 and it will not support 2008.
    John A. Booth

Maybe you are looking for

  • Error with Date Variable

    I am trying to create a process to import to import data using a date variable but when I use the date to get the data from SQL server I am getting a error. I have tried setting the variable as both a string and date - Select CONVERT(varchar(10), DAT

  • Import pdf as rastered image into a c++ application

    Hi Everyone, I am developing a commercial application which processes rastered images. Additionally to bitmap formats like BMP and TIFF the application has to be able to load and process PDF-files. The PDFs only contain one page. To make it harder, s

  • Including file in Servlet

    I want that despite writing repeatedily the code for db connectivity I should make one file and just include it to my each servlet file to connect db plz help

  • UDF or Adapter?

    XI Geeks, we have a scenario IDOC to file. can create file at OS level using UDF with no Receiver  & Sender agreements. when UDF can serve the purpose of an adapter what else we need,just need configuration part in identifying the right UDF thorugh r

  • How do I get iPhone 3GS videos to automatically sync t Apple TV?

    How can I get the 3Gs video clips automatically to my Apple TV? They seem to just import in to iPhoto, but I'm not sure how to get them from there in to iTunes (Movies) automatically. Do I need to manually drag them in to iTunes each time I have a ne