Greetings to all. I have the following problem I have a procedure stored in SQL Server that retrieves data with the like operator, but it does not work for me.
create procedure recupera_art
@cadena char(40)
select * from articulo where clave like '%'+ @cadena +'%'
change the procedure like this:
create procedure recupera_art
@cadena char(40)
select * from articulo where clave like @cadena
and from my application (vb.net) I pass the parameter in this way:
cmd.Parameters.AddWithValue("@cadena", "%" + dts.gclave_art + "%")
but it works to me half, that is to say I have the following keys (AX101080, ..., AX101095), when wanting to make the query I do not do anything when putting A, AX, AX1 or AX10, I have to put AX101 so that I started to filter all the data in the table.
What I want is that by putting AX, A, AX1 or AX10 I can filter the data, I think that is possible.
I appreciate your help to solve the problem.