SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
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  

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

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

Patron Saint of Lost Yaks

30417 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

Flowing Fount of Yak Knowledge

8780 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 1.17 seconds. Powered By: Snitz Forums 2000