Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing % sign to variable

Status
Not open for further replies.

scottch

Programmer
Aug 12, 2003
1
DE
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.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top