Link to home
Start Free TrialLog in
Avatar of ExpressMan1
ExpressMan1Flag for Canada

asked on

Stored Procedure Error converting data type nvarchar to int.

I created the following stored procedure:
CREATE PROCEDURE spGetMarkup
@CustomerID int,
@OriginCountryID int,
@DestinationCountryID int,
@ServiceID int,
@PackageTypeID int,
@Markup int OUTPUT
AS

SELECT @Markup =(Markup)
FROM tblMarkups
WHERE (CustomerID = @CustomerID) AND
            (OriginCountryID = @OriginCountryID) AND
            (DestinationCountryID = @DestinationCountryID) AND
            (ServiceID = @ServiceID) AND
            (PackageTypeID = @PackageTypeID)

I get the error when when executing.  "Error converting data type nvarchar to int".    All fields in the table are int datatype.

DECLARE @Markup int
EXECUTE spGetMarkup @CustomerID = 124001, @OriginCountryID = OriginCountryID, @DestinationCountryID = DestinationCountryID, @ServiceID = ServiceID, @PackageTypeID = PackageTypeID, @Markup = @Markup OUTPUT
SELECT @Markup
ASKER CERTIFIED SOLUTION
Avatar of Phil Davidson
Phil Davidson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ExpressMan1

ASKER

Thanks Phil.

That was it.  Should have been @OriginCountryID = 1, DestinationCountryID =2, etc