Microsoft Knowledge Base Email Alertz

(239725) - When you run a parameterized query, with a parameter of type decimal and a precision of 38, against a SQL Server 7.0 database using the 3.70 driver, you may receive the following error message: Server: Msg 2750, Level 16, State 1, Procedure...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 239725 - Last Review: December 5, 2003 - Revision: 4.1

BUG: SQL Server Error "Specified Column Precision 38 Is Greater Than the Maximum Precision of 28. (2750)" When Running Parameterized Query

This article was previously published under Q239725
BUG #: 55723 (SQLBUG_70)

On This Page

SYMPTOMS

When you run a parameterized query, with a parameter of type decimal and a precision of 38, against a SQL Server 7.0 database using the 3.70 driver, you may receive the following error message:
Server: Msg 2750, Level 16, State 1, Procedure #odbc#efwadm19151b, Line 0 Column or parameter #2: Specified column precision 38 is greater than the maximum precision of 28. Parameter '@P2' has an invalid data type.

CAUSE

The SQL ODBC driver uses a default value of 38 for the precision value if the application specifies SQL_DEFAULT for the precision when binding a decimal parameter. However, the default decimal precision on the SQL Server is 28.

WORKAROUND

To work around this problem, start SQL Server with a -p38 parameter to set the default server precision to 38.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0.

MORE INFORMATION

Steps to Reproduce Problem

  1. Cut and paste the following code into SQL Query Analyzer:
      CREATE TABLE [dbo].[abcd] (
    	[a] [int] NULL ,
    	[b] [datetime] NULL ,
    	[c] [decimal](18, 5) NULL ,
    	[d] [int] NULL 
    ) ON [PRIMARY]
    GO
    					
  2. Attempt to execute the following:
    create proc #odbc#efwadm19151b(@P1 int,@P2 decimal(38,5),@P3 int) as  INSERT INTO abcd( a, b, c, d) VALUES (@P1, getdate() ,@P2,@P3)
    					

APPLIES TO
  • Microsoft SQL Server 7.0 Standard Edition
  • Microsoft ODBC Driver for Microsoft SQL Server 3.7
  • Microsoft Data Access Components 2.1
  • Microsoft Data Access Components 2.5
  • Microsoft Data Access Components 2.6
Keywords: 
kbbug kbpending KB239725
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate