Geeks With Blogs
Bill Jones Jr. MVP Visual Basic Charlotte NC - MCP C# and VB.Net - Founder and President of the Enterprise Developers Guild (.Net User Group)

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 1, 2005 4:40 PM 3. Who knew? | Back to top

Related Posts on Geeks With Blogs Matching Categories

Comments on this post: SQL Server 2K and decimal variables

# re: SQL Server 2K and decimal variables
Requesting Gravatar...
I was so much irritated and was not able to find correctly but you have helped.
Thank You
Left by raj on Dec 28, 2005 1:30 AM

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

Your comment:
 (will show your gravatar)

Copyright © Bill Jones Jr. | Powered by: