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
 Transact-SQL (2005)
 column - data type

Author  Topic 

programer
Posting Yak Master

221 Posts

Posted - 2010-10-24 : 10:34:05
Hi All,

My data is:
1.3934
113.18
1.9558
24.626
7.4577
15.6466
0.88730
275.35
3.4528
0.7097
3.9701
4.3013
9.2565
1.3533
8.1430
7.3365
42.4507
1.9896
1.4198
2.3594
1.4299

What data type should I use and how many posts should be?
This time use data type = numeric (18.4)
This is not good.
.
Do I need to be increased to (18.8)?

Please Help

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-10-24 : 12:26:50
this is one thing you need to decide based on your business needs. How much are the decimals important for business.

otherwise if you don't know in advance the how much decimals will there be i suggest you use datatype float.

try this:

drop table test123

create table test123
(numF float
,numD decimal(18,8)
)
insert into test123
select 1.2457436785634534,1.6543876597

select * from test123
Go to Top of Page

programer
Posting Yak Master

221 Posts

Posted - 2010-10-24 : 13:12:42
It is likely to float an ideal solution.
This need for exchange rates.

quote:
Originally posted by slimt_slimt

this is one thing you need to decide based on your business needs. How much are the decimals important for business.

otherwise if you don't know in advance the how much decimals will there be i suggest you use datatype float.

try this:

drop table test123

create table test123
(numF float
,numD decimal(18,8)
)
insert into test123
select 1.2457436785634534,1.6543876597

select * from test123


Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-10-24 : 13:31:50
look at this:
http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html

and you will get the idea of exchange rates and decimals.

i still suggest float as best option.
Go to Top of Page
   

- Advertisement -