SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 decimal with sign
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kimi86
Yak Posting Veteran

79 Posts

Posted - 03/27/2013 :  11:36:08  Show Profile  Reply with Quote
I need to store a decimal number (17 degits before decimal and 2 after )on a table with sign
e.g.
+0000000001234.12


What should be the datatype of the column
dicimal(17,2) does not store sign if +

SwePeso
Patron Saint of Lost Yaks

Sweden
30277 Posts

Posted - 03/27/2013 :  11:51:13  Show Profile  Visit SwePeso's Homepage  Reply with Quote
The only datatype that will store the plus sign for you is CHAR or VARCHAR.
You also use VARBINARY or BINARY if you don't want the data to be humanly readable.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

webfred
Flowing Fount of Yak Knowledge

Germany
8765 Posts

Posted - 03/27/2013 :  11:52:19  Show Profile  Visit webfred's Homepage  Reply with Quote
1. decimal(19,2) if you need 17 and 2
2. You don't need to store that data formatted! Display format should be done in the front end when displaying the data.



Too old to Rock'n'Roll too young to die.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000