If you would like to get customer by his id, try this:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE SelectCustomerByID
@cit int = 0
AS
BEGIN
SET NOCOUNT ON;
SELECT *
FROM Customers
WHERE CustomerId = @cit
END
GO
but if you would like to select customers by ID which id's starting with some value, for ex.: 1*, 10*, 123*
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE SelectCustomersLikeID
@cit int = 0
AS
BEGIN
SET NOCOUNT ON;
SELECT *
FROM Customers
WHERE CONVERT(VARCHAR, CustomerId) Like CONVERT(VARCHAR, @cit) + '%'
END
GO
In both cases you should call these sp:
DECLARE @RC int
DECLARE @cit int
SET @cit = 1
EXECUTE @RC = [A_TEST].[dbo].[SelectCustomerByID] @cit
EXECUTE @RC = [A_TEST].[dbo].[SelectCustomersLikeID] @cit
In the first case, you'll get only one result. In the second case, you'll get as many records, as many CustomerID starts with '1'.
I hope it will be helpful.