| Author |
Topic |
|
newbie007
Starting Member
37 Posts |
Posted - 2009-04-09 : 05:40:41
|
| I have a table where one of the columns has data with 5 decimal points eg, 17.23452. I entered it as a numeric /decimal data type but it is being displayed without the decimal points - only the whole numbers are shown. How can I get the decimal points ? |
|
|
Mangal Pardeshi
Posting Yak Master
110 Posts |
Posted - 2009-04-09 : 05:50:32
|
| What scale and precision you have defined?see the exampleDECLARE @A decimal, @b decimal(5,3)select @a=18.256, @b=18.256select @a, @bdoes it explain what you may have missed?Mangal Pardeshihttp://mangalpardeshi.blogspot.com |
 |
|
|
newbie007
Starting Member
37 Posts |
Posted - 2009-04-09 : 06:05:33
|
quote: Originally posted by Mangal Pardeshi What scale and precision you have defined?see the exampleDECLARE @A decimal, @b decimal(5,3)select @a=18.256, @b=18.256select @a, @bdoes it explain what you may have missed?Mangal Pardeshihttp://mangalpardeshi.blogspot.com
sorry - i dint get you.im importing the date from a file. the particular column has 5numbers following the decimal point.in enterprise manager ive given data type as numeric but the table only displays the whole number (without figs after the decimal point) how do i rectify this ? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-09 : 06:09:24
|
quote: Originally posted by newbie007
quote: Originally posted by Mangal Pardeshi What scale and precision you have defined?see the exampleDECLARE @A decimal, @b decimal(5,3)select @a=18.256, @b=18.256select @a, @bdoes it explain what you may have missed?Mangal Pardeshihttp://mangalpardeshi.blogspot.com
sorry - i dint get you.im importing the date from a file. the particular column has 5numbers following the decimal point.in enterprise manager ive given data type as numeric but the table only displays the whole number (without figs after the decimal point) how do i rectify this ?
it should be decimal(10,5)MadhivananFailing to plan is Planning to fail |
 |
|
|
newbie007
Starting Member
37 Posts |
Posted - 2009-04-09 : 06:29:15
|
| [[/quote]it should be decimal(10,5)MadhivananFailing to plan is Planning to fail[/quote]where/how do i apply this decimal(10,5) ? whats the syntax ? |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2009-04-09 : 07:17:00
|
| In BOL (books online, the help included with SQL Server), look up ALTER TALBE and ALTER COLUMN.[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQL or How to sell Used CarsFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
newbie007
Starting Member
37 Posts |
Posted - 2009-04-09 : 13:47:14
|
quote: Originally posted by DonAtWork In BOL (books online, the help included with SQL Server), look up ALTER TALBE and ALTER COLUMN.[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQL or How to sell Used CarsFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp
ive triedALTER Table TAlter Column C Decimal (10,5)(T- my table, C - column)The values are still being displayed without nay decimal points |
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2009-04-09 : 13:59:48
|
| trying importing the file again after you alter the table. |
 |
|
|
newbie007
Starting Member
37 Posts |
Posted - 2009-04-11 : 04:52:00
|
quote: Originally posted by sakets_2000 trying importing the file again after you alter the table.
1)My data needs to be imported from 6 different files.Instead can I create new table with the above decimal specifications and then copy all data from the existing table2)Is it possible to import data from different files onto a single table using enterprise manager/DTS/import data |
 |
|
|
|