You are here: Re: Truncated Decimals « MsSQL Server « IT news, forums, messages
Re: Truncated Decimals

Posted by Erland Sommarskog on 12/05/88 11:37

orandov@gmail.com (orandov@gmail.com) writes:
> I am relatively new to SQL server. I am tring to send some decimal
> values to the database using a stored procedure with parameters of type
> DECIMAL. Every time it inserts the values into the database the
> decimals are truncated. I saw on the MSDN library that you have to set
> the precision and scale values b/f you run the stored procedure. So I
> set the precision to 8 and the scale to 4 and it still didn't help. Can
> anyone help me?

Since I don't know what you are doing exactly, it's difficult to help.
It would be a good idea to include the CREATE TABLE statement for the
table, and the code to your procedure.

In the meanwhile, here is a working example:

CREATE TABLE bulle (d decimal(8,4) NOT NULL)
go
CREATE PROCEDURE bulle_sp @d decimal(8,4) AS
INSERT bulle (d) VALUES (@d)
go
EXEC bulle_sp 9.2344
go
SELECT * FROM bulle
go
DROP TABLE bulle
DROP PROCEDURE bulle_sp

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация