Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asp.net error when calling stored procedure

Status
Not open for further replies.

spDavCom

Programmer
Feb 16, 2003
13
US
ERROR:

Implicit conversion from data type nvarchar to money is not allowed. Use the CONVERT function to run this query.

NOTE:

I'm passing a param to the stored proc from an asp.net text box or string variable.

STORED PROC:

CREATE PROCEDURE [sp_FindByAmount] @pAmount money AS
SELECT DATE, CHECK_ID, DESCRIPTION, AMOUNT, RECID
FROM tblCheckBook2000
WHERE AMOUNT = @pAmount
ORDER BY DATE
GO


QUESTION:

What must I change in the stored procedure ? and or , how do I use CONVERT , so that I can rid myself of this error??

Thank YOU, Any examples of syntax would be much appreciated.
 
Is your Amount column of data type money? If so, then calling the SP with this line should work:

Code:
EXEC sp_findbyamount 10.50

ie, don't use a char value as input:

Code:
EXEC sp_findbyamount '10.50'
--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top