Hi
We have successfully migrated a SQL 6.5 stored procedure to SQL 2000. This SP is called from an ASP web page, which also passes some parameters. However we are having problems using these parameters in a select clause.
Basically the SP looks like this (at least the relevant parts):
CREATE PROCEDURE GetArticles (@Article varchar(16)="",..., @ArtText varchar(40) = "") AS
....
Select <...> where (Articles.ArtText like @ArtText)
This last line used to work in 6.5 but now we are having problems with the "like" structure. Basically the @ArtText parameter contains a string (empty or not) with a %-sign both in front and at the end.
So it looks like %%, %test%, etc. Unfortunately we get no data at all when executing the SP. We tried different approaches with the quotes (add single quotes to the parameter, but quotes around @ArtText, etc.) but nothing seems to work. Does anyone know how to make a like-clause work with a parameter?
Thanks!
We have successfully migrated a SQL 6.5 stored procedure to SQL 2000. This SP is called from an ASP web page, which also passes some parameters. However we are having problems using these parameters in a select clause.
Basically the SP looks like this (at least the relevant parts):
CREATE PROCEDURE GetArticles (@Article varchar(16)="",..., @ArtText varchar(40) = "") AS
....
Select <...> where (Articles.ArtText like @ArtText)
This last line used to work in 6.5 but now we are having problems with the "like" structure. Basically the @ArtText parameter contains a string (empty or not) with a %-sign both in front and at the end.
So it looks like %%, %test%, etc. Unfortunately we get no data at all when executing the SP. We tried different approaches with the quotes (add single quotes to the parameter, but quotes around @ArtText, etc.) but nothing seems to work. Does anyone know how to make a like-clause work with a parameter?
Thanks!