Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Numeric Field Space Requirements

Author  Topic 

spthomas
Starting Member

14 Posts

Posted - 2010-09-02 : 15:49:13
I have data files coming in from an outside source that I have to store in SqlServer 2005. They have several numeric fields that are really big (Numeric(20) or Numeric(22)). They can't get me more information about the actual size of the data in these fields (thought I doubt it's that large really), so I have to size for that.

My question is this: If the numbers come in a lot smaller than this, but I've sized the column for Numeric(22), will it take up that same 13 bytes no matter what the actual data is?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-09-02 : 15:58:52
Probably, unless you define the column as vardecimal, see Books Online for details. If you use float (or real) you'll save space but lose precision, and can't do accurate math operations with it.
Go to Top of Page

spthomas
Starting Member

14 Posts

Posted - 2010-09-03 : 10:11:16
That's what I thought. But most of my db training is 20 years old, so I wanted to be sure there wasn't something new going on. I'll read up on vardecimal. And since these are financial apps, float or real are probably out of the question.

Steve
Go to Top of Page
   

- Advertisement -