Are you using quick search in the SQL History and don't get the results you're looking for? By default search scans the first 50 characters of the SQL script (SQL Preview column in the history list). The reason for this is that searching may be time consuming if having many and/or big scripts. The following screenshot show how to enable full search:
The list of history entries now show the expected result:
Enabling full script search is not saved between sessions.