1
I created a simple process, it takes a parameter and should return the data according to this parameter:
CREATE PROCEDURE [dbo].[testeLike]
-- Add the parameters for the stored procedure here
@teste varchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
select * from teste
where valor like '@teste%'
END
executing the proc:
did not return any data:
But if I take the select code and test it, the data is returned:
select * from teste
where valor like 'tes%'
I can’t understand what the problem is. In the parameter I tried to pass with simple quotes, but gave anyway.