Search Error

Hi all
I have a code snippet below used to search for values in table

I am having problem with searching for values with 00 as string
why would the query be returning only the first records set and not the rest of 100's


The command is run withing the store procedure

set @sql_where        = ' and (Table.F0ArtNr like '''+@strSuchStr+''')'

The where statement goes    =    where        Table.F0ArtNr like @strSuchStr

and
 

if substring(@strSuchStr,1,1) = '?'
            begin
            set @sZahl = substring(@strSuchStr,2,len(@strSuchStr))
            end
        else
            begin
            set @sZahl = @strSuchStr
            end
   
        if isnumeric(substring(@sZahl,1,6)) = 1
            begin
            set @iSearchArtNr = 1
            end
        else
            begin
            set @iSearchArtNr = 0
            end
 
        set @strSuchStr = upper(ltrim(rtrim(@strSuchStr)))+'%'
 
 
        if substring(@strSuchStr,1,1) = '?'
            begin
            set @strSuchStr = '%'+substring(@strSuchStr,2,len(@strSuchStr))
            end

Open in new window

ZURINETAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

momi_sabagCommented:
i didn't understand your problem
0
ZURINETAuthor Commented:
Hi

Would any of the set @strSuchStr = '%'+substring(@strSuchStr,2,len(@strSuchStr))
construct be removing 00 in a string

That is if I decide to search for 000999
would the substring be removing the 00 in the string?
0
momi_sabagCommented:
no
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ZURINETAuthor Commented:
What I know is that one of this substring is removing all the 0 digits if the search string starts with 0
0
ZURINETAuthor Commented:
Will run a test in console and find out which on is doing this
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.