Windows Search – enabling search in .sql files

It’s one of those little annoyances working with Windows that I encounter now and then, when Microsoft disables something, without giving us a user friendly way of overriding their choice. Someone on the public forum complained about Windows Search because he could not find some Oracle supplied sql script that is responsible for particular object creation. Of course, files with extension .sql are excluded from the Windows Search by default.

Out of the box (Windows XP/2003) an attempt to find some string in .sql scripts will not reveal anything (see example in the picture).


Microsoft knowledge base article KB309173 describes two methods to enable search in files that are by default excluded by Windows Search (such as .log, .sql, .xml, …). I prefer method 1, enabling search for particular extension (such as .sql, .log, .xml) instead of turning off completely the restriction.

In short:
1) open registry editor and navigate to HKEY_CLASSES_ROOT\.sql or another extension of your choice, such as .log, .xml,…
2) since we know that we’re dealing with plain text in those files we can add Plain Text handler by adding key named PersistentHandler with the default value {5e941d80-bf96-11cd-b579-08002b30bfeb}.


3) After log off / logon Windows search should find the string in .sql files


Posted on 30.12.2008, in MS Windows and tagged . Bookmark the permalink. Comments Off on Windows Search – enabling search in .sql files.

Comments are closed.