0

if i have these two complicated query strings

 ALM_frmTopAlarmHistoryReport.aspx?strAlarmConnection=AlarmSystem

AND

 http://1.1.4.1/xyz/ALM_frmAlarmHistoryReport.aspx?ViewPDF=
 1&dtmStartDate={0}&dtmEndDate={1}& + '&lngAlarmGroup=' + 
 $('#ddlAlarmGroup').val() + '&lngProcessor=' + $('#ddlProcessor').val() + 
 '&intCategory=' + $('#ddlCategory').val()

how can i excuete a select WHERE LIKE condition i tried

 SELECT * FROM [tablename] WHERE string1 LIKE '%string2%' 

and i got the following error

   Msg 103, Level 15, State 4, Line 1
   The identifier that starts with'%string2 ' is too long. Maximum length is 128.

any help will be very welcome thanks in advance

1 Answer 1

1

Use locate or instr instead:

select *
from tablename
where instr(string2, string1)  > 0
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.