ExpressMan1
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That was it. Should have been @OriginCountryID = 1, DestinationCountryID =2, etc