The stored proc below does not display any results with SQL Server 2005. I can take the same instructions and run it as a query and I get results, What am I missing.
ALTER PROCEDURE [dbo].[usp_SubtractStops]
@p NVARCHAR(1024) = '209 208 207 206 205 204 203 113 297 19 7 12 11 6 232 233 234 235 236 237 273 271 272 210 211 212 213 214 215 247',
@q NVARCHAR(1024) = '209 208 207 206 205 204 203 113 297 19 7 12 11 6 232 233 234 235 236 237'
--SET @p = '209 208 207 206 205 204 203 113 297 19 7 12 11 6 232 233 234 235 236 237 273 271 272 210 211 212 213 214 215 247'
--SET @q = '209 208 207 206 205 204 203 113 297 19 7 12 11 6 232 233 234 235 236 237'
AS
BEGIN
SET NOCOUNT ON;
SELECT StoppingPattern,
Replace(StoppingPattern, @p, @q)
FROM tLicTripStops
WHERE ',' + @p + ',' LIKE '%,' + StoppingPattern + ',%'
AND LastItemID = 247
END