|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
set column precisionhey guys, need a little advice here. if i want to restrict a column to a decimal precision of 2 - can i do this when i create the table.
and should i use a decimal or float datatype. i just want to force two decimal places. or do i just allow the datatype to default and then set the precsion when a stored procedure is called with the ROUND(myData,2)? i've been using float for this column but its storing input that originated as 63.37 and converting it to 63.369999. thanks for any help on this rik ********************************************************************** Sent via Fuzzy Software @ http://www.fuzzysoftware.com/ Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... > hey guys, need a little advice here. if i want to restrict a column to a CREATE TABLE dbo.TableName> decimal precision of 2 - can i do this when i create the table. ( ColumnName DECIMAL(12, 2) ) > and should i use a decimal or float datatype. DECIMAL. FLOAT is for approximate values and will usually lead to rounding issues unless it provides specific functionality for your app that DECIMAL can't provide. For currency or other low-decimal numbers, it is rarely an appropriate choice. A excellent. thanks for such a quick answer.
rik ********************************************************************** Sent via Fuzzy Software @ http://www.fuzzysoftware.com/ Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... |
|||||||||||||||||||||||