September 22, 2008 at 3:02 pm
Can somebody answer what datatype and precision this value should have. i am bit confused over this issue.In oracle its Number 22 and i am assigned to change datatypes in oracle to SQL server.
19214331247300.5
September 22, 2008 at 3:57 pm
It fits into a numeric (15,1). Any numeric (or decimal, they're equivalent) with a precision of 15 or higher and a scale of 1 will work.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 22, 2008 at 4:02 pm
could you please reason out . rather let my question be in this way
How you decide for number 22 , numeric (15,1) is suffiecient. my SSMA Migration tool went for numeric (4,1). Is there any logic or is it random based on numbers .Sorry for cross posting.Didnt knew sorry again.
September 22, 2008 at 4:11 pm
Precision is the total number of digits in the number (to the left and right of the decimal place). Scale is the number of digits to the right of the decimal place.
The number you posted had 14 digits to the left of the decimal place and 1 to the right. That means that, at a minimum, it needs a precision of 15 (14+1) and a scale of 1.
I don't know what a Number(22) is on Oracle. I was judging just from what you posted. If there are larger numbers in that column, or numbers with more decimal places, then you'll need a different scale and precision
The largest number that can fit into numeric(4,1) is 999.9
select CAST('1000' as numeric (4,1))
Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting varchar to data type numeric.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 22, 2008 at 4:17 pm
thanks i got an pretty much clearned from your posting.
Regards i really appreciate your effort
September 22, 2008 at 4:24 pm
Pleasure.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 22, 2008 at 6:32 pm
GilaMonster (9/22/2008)
Pleasure.
I'm sorry I missed it... Congrats on the 6k milestone, Gail. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
September 23, 2008 at 12:43 am
Jeff Moden (9/22/2008)
I'm sorry I missed it... Congrats on the 6k milestone, Gail. 🙂
😀 Thanks.
Working from home means I can keep a better eye on the place. :hehe:
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply