CREATE PROCEDURE [dbo].[GetIssuedGatePassByGatepassType]
(
@GatePass_Type int,
@plant int
)
AS
SET NOCOUNT ON;
SELECT
GatePass_Type, Batch_No, Issued, Batch_Id
FROM
GatePass_Batch
WHERE
(Issued = 0)
AND (GatePass_Type = @GatePass_Type)
AND Location_Id = @plant
ORDER BY
CAST(Batch_No AS INT) ASC
Batch_no
is of data type varchar
in table
This gives me an error like
conversion failed varchar to data type int
Please give answer