Hey all,Ive got to return some data from a table for an asp page. The problem is that the data is in a total mess.example...the column data shoud be : SL-TOP 340However, this is actually in the table as:SL TOP 340SLTOP 340SL340What I would like to do is check the type of character after the 'SL'if it's a numerical character (ie: SL340) then show it. if its a letter (ie: SLTOP 340) don't show it.I have managed to used the following on a simple string:DECLARE @str1 VARCHAR(200)DECLARE @str2 VARCHAR(10)DECLARE @str3 VARCHAR(200)DECLARE @Temp VARCHAR(1)SET @str1 = 'SL TOP 340'SET @str2 = 'SL TOp'SET @str3 = REPLACE(@str1, @str2, '')IF ASCII(@str3) IN (32, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57) BEGIN SET @temp = 'y-'ENDELSEBEGIN SET @temp = 'n-'ENDSELECT @str3, @Temp
(The ASCII codes are space, hyphen and numbers 0-9)hope that's explained well enough!This works for a single string in this example - But how would I crowbar this into a searchResults stored procedure...I've been told to use a temporary table but im stuck as to how to check the value of each row..Thanks for reading,Pete