hi guys help me check why this stored procedure is generating error that ii cannot convert numeric value to smallmoneyCREATE PROCEDURE STP_INSERT_TRANSACTION_CASH @TransactionTypeId int, @Description varchar(50), @TransactionOwnerId int, @TransactionDate smalldatetime, @PaymentTypeId int, @CollectorAccountNumber varchar(30), @AmountPaid smallmoney, @UserId varchar(20), @PayerCode varchar(30), @Collector varchar(30), @TransactionClassId intAS Declare @TransactionId int, @TransactionDetailId int ,@TransactionAccountingId int,@CustomerCode varchar(30),@AmountDiff smallmoney SET @CustomerCode =@PayerCode Begin Transaction BEGIN INSERT INTO [Transaction](TransactionTypeId,PaymentTypeId,TransactionClassId,TransactionOwnerId,TransactionDate,[Description]) VALUES(@TransactionTypeId,@PaymentTypeId,@TransactionClassId,@TransactionOwnerId,@TransactionDate,@Description) SET @TransactionId = SCOPE_IDENTITY() IF @@Error<> 0 goto Push END INSERT INTO TransactionDetails(TransactionId,UserId,PayerCode,Collector) VALUES(@TransactionId,@UserId,@PayerCode,@Collector) SET @TransactionDetailId = SCOPE_IDENTITY() IF @@Error<> 0 goto Push INSERT INTO TransactionAccounting(TransactionDetailId,TransactionId,CollectorAccountNumber,AmountPaid) VALUES (@TransactionDetailId,@TransactionId,@CollectorAccountNumber,@AmountPaid) SET @TransactionAccountingId = SCOPE_IDENTITY() IF @@Error<> 0 goto Push INSERT INTO PaymentLog(CustomerCode,AmountPaid,Collector,PaymentDate, TransactionAccountingId) VALUES (@CustomerCode,@AmountPaid,@Collector,@TransactionDate,@TransactionAccountingId) IF @@Error<> 0 goto Push UPDATE UserAccount SET LastAmountPaid = @AmountPaid, @AmountDiff = CustomerBill - @AmountPaid, LastDateOfPayment = @TransactionDate, OutstandingBill =OutstandingBill + @AmountDiff, CustomerBill =0 WHERE CustomerCode = @CustomerCode IF @@Error <> 0 goto Push Commit Transaction Return 0Push:BEGIN Rollback Transaction RETURN 1END
i try to execute this stored procedure with statement belowExecute STP_INSERT_TRANSACTION_CASH 1,tyuio,2,'2-4-2003',1, 20005, CAST(345655.897890888 AS smallmoney(4)),jaksalabi,sirbob,'2-3-05'
it give the following Error:Line 1: Incorrect syntax near '345655.897890888'.Chris