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
 General SQL Server Forums
 New to SQL Server Programming
 Datatype conversion

Author  Topic 

khasim76
Starting Member

35 Posts

Posted - 2008-09-22 : 16:45:26
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

khasim76
Starting Member

35 Posts

Posted - 2008-09-22 : 16:57:33
Please help
Go to Top of Page

pommguest99
Starting Member

16 Posts

Posted - 2008-09-22 : 17:06:06
--I confess, Im not an expert by the way.

Assuming "Number 22" means a numeric of size 22, you can say the following try -

DECLARE @Column numeric(22,1)

Go to Top of Page

khasim76
Starting Member

35 Posts

Posted - 2008-09-22 : 17:10:03
why it should not be float
Go to Top of Page

khasim76
Starting Member

35 Posts

Posted - 2008-09-22 : 17:10:45
my question which is best to declare it as float or number
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-22 : 17:10:56

http://msdn.microsoft.com/en-us/library/ms187746.aspx
Go to Top of Page

khasim76
Starting Member

35 Posts

Posted - 2008-09-22 : 17:11:04
sorry numeric
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-22 : 17:15:35
use numeric(18,2) Thats the default
With a precision of 18 and scale of 2
Go to Top of Page

khasim76
Starting Member

35 Posts

Posted - 2008-09-22 : 18:14:01
what would be general logic to support infront of my project manager

for say number 22 in oracle i am changing to numeric(16,2).

i have still 22 columns in this way where i need to change the datatypes please help me out.
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-22 : 22:21:15
22 columns ? When you change the datatype It automatically changes all related columns
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-23 : 00:13:28
quote:
Originally posted by afrika

22 columns ? When you change the datatype It automatically changes all related columns


what do you mean by that?
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2008-09-23 : 04:18:14
quote:
Originally posted by visakh16

quote:
Originally posted by afrika

22 columns ? When you change the datatype It automatically changes all related columns


what do you mean by that?



If a column "ProductID" datatype was numeric(8,2) and all values in the column where restricted to this, when you change the property to numeric(18,2) all values will be adjusted to fit the new value.
Go to Top of Page
   

- Advertisement -