Bill Jones Jr. MVP Visual Basic

Charlotte NC - MCP C# and VB.Net - Founder and President of the Enterprise Developers Guild (.Net User Group)

  Home  |   Contact  |   Syndication    |   Login
  32 Posts | 0 Stories | 53 Comments | 32 Trackbacks

News

My wife, my pastor, my company, my boss, my friends and all my user group members reserve the inalienable right to disavow anything published here. My children will just to have to get over it. The cat doesn't speak to me anyway.

Enterprise Developers Guild - Charlotte MSDN .NET User Group

Archives

Post Categories

What I think I saw - So there I was happily loading a DECLAREd variable with a SELECT statement in a SQL Server SProc.  The variable was declared like this:

 

DECLARE @myVar decimal

 

The value I was retrieving was decimal - precision 19.2 - but what I got in my decimal variable was integer.   So I changed to a more specific definition like:

 

DECLARE @myVar decimal(19,2)

 

And then got what I expected, a decimal value.  So I’m guessing the “decimal” declaration must default to something like “decimal(19,0)”. 

 

Who knew?

 

  Bill J

  Charlotte NC

 

posted on Sunday, May 01, 2005 4:40 PM

Feedback

# re: SQL Server 2K and decimal variables 12/28/2005 1:30 AM raj
I was so much irritated and was not able to find correctly but you have helped.
Thank You

# re: SQL Server 2K and decimal variables 3/20/2007 10:17 AM Joris
Great! Thanks, this was very helpful :) I had exactly the same problem and had no clue what I could do to solve it.

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: