Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Using a Stored Procedure to Insert Decimal values

Posted 18 Dec 2001 02:07:36
1
has voted
18 Dec 2001 02:07:36 Owen Eastwick posted:
Hi,

I have set up a SQL Server Database in which I have made extensive use of stored procedures.

However no mater what I try I cannot pass a decimal or numeric value to the stored procedure from an .asp page.

e.g

Here's my stored procedure:
----------------------------------------------------------
CREATE PROCEDURE spTestInsert

@Fint int,
@Fmoney money,
@Fnumeric numeric,
@Fdecimal decimal,
@Fvarchar varchar(50),
@Ftext text

AS

SET NOCOUNT ON

INSERT INTO tblTest(Fint, Fmoney, Fnumeric, Fdecimal Fvarchar, Ftext)

VALUES(@Fint, @Fmoney, @Fnumeric, @ Fdecinal, @Fvarchar, @Ftext)

SET NOCOUNT OFF
GO
-------------------------------------------------------------

My table is set up as follows:

ColumnName - Data Type - Length - Allow Nulls - Description

RecID - int - 4 - No - Identity, Seed 1, Increment 1.
Fint - int - 4 - Yes - Integer
Fmoney - money - 8 - Yes - Precision 19, Scale 4.
Fnumeric - numeric - 9 - Yes - Precision 18, Scale 4.
Fdecimal - decimal - 9 - Yes - Precision 18, Scale 4.
Fvarchar - varchar - 50 - Yes
Ftext - text - 16

I have trawled the web and read up on ADO at Microsoft regarding appending parameters but I can't seem to crack this one.

Everything else works, I can insert text, date, money and integers without any problems but it screws up whenever I try numeric or decimal values.

Any ideas anyone?

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo

Reply to this topic