Monday, February 20, 2012

Problem inserting decimal data

Hi all,
I have a number of columns in an SQL server table that are of type Decimal.
The problem is, when I create a stored procedure and add decimal data to the
table, the decimal places are chopped off. The number of decimal places to
be stored is set to auto, so that should be ok.
Does anyone know what would cause this?
Thanks to anyone who can help
SimonSimon
Can you show us your INSERT statement?
CREATE TABLE #Test
(
col DECIMAL (18,2)
)
GO
INSERT INTO #Test VALUES (12.5)
INSERT INTO #Test VALUES (10.55)
INSERT INTO #Test VALUES (8.99)
GO
SELECT * FROM #Test
"Simon Harvey" <sh856531@.microsofts_free_email_service.com> wrote in message
news:ueWav8PMEHA.808@.tk2msftngp13.phx.gbl...
> Hi all,
> I have a number of columns in an SQL server table that are of type
Decimal.
> The problem is, when I create a stored procedure and add decimal data to
the
> table, the decimal places are chopped off. The number of decimal places to
> be stored is set to auto, so that should be ok.
> Does anyone know what would cause this?
> Thanks to anyone who can help
> Simon
>

No comments:

Post a Comment