Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored Proc using LIKE,...why's that so hard?

Author  Topic 

Max
Starting Member

5 Posts

Posted - 2000-12-14 : 11:55:22
Hi all-

Can someone please tell me what I'm doing wrong!

I send in a number to search for (ie., 5568) and I need it to return all variations of that string (ie. it should return, 5568-A, 5568-B, 5568-Z, ...) but it will ONLY return 5568, it's like it is not wildcarding at all. I've tried multiple quote combinations unsuccesfully.

Any ideas? Thanks kindly in advance!

--------------------------------------------------------
CREATE PROCEDURE sp_GetLotBatch @LotNumber char(10) AS

SELECT *
FROM tblLot
WHERE tblLot.LotBatch LIKE "%%%" + @LotNumber + "%%%"
--------------------------------------------------------




max
   

- Advertisement -