Hello,
I am trying to set up a stored procedure, which requires a variable, followed by a % sign. The only way I could work this was to use a plus as follows
SELECT '0010 RU RACF ', COUNT(*)
FROM rss_user ru
WHERE ( ru.rss_name = 'RACFP'
AND ru.rss_user_name LIKE @t_kenn + "%"
AND ru.status <> 3 )
There are 3 commands just like this.
Unfortunately, the performance of this is abysmal, changing what would normally take .30 seconds to take 14.5 seconds. I figured out this is because at every record, it is adding the percent sign. Is there any other way I could pass a LIKE @variable% without using a plus?
Any help would be greatly appreciated.
Scott Cheadle.
I am trying to set up a stored procedure, which requires a variable, followed by a % sign. The only way I could work this was to use a plus as follows
SELECT '0010 RU RACF ', COUNT(*)
FROM rss_user ru
WHERE ( ru.rss_name = 'RACFP'
AND ru.rss_user_name LIKE @t_kenn + "%"
AND ru.status <> 3 )
There are 3 commands just like this.
Unfortunately, the performance of this is abysmal, changing what would normally take .30 seconds to take 14.5 seconds. I figured out this is because at every record, it is adding the percent sign. Is there any other way I could pass a LIKE @variable% without using a plus?
Any help would be greatly appreciated.
Scott Cheadle.