7

I've set the index options for the .SQL extension to use "Plain Text filter" with "Index Properties and File Contents" selected, and ensure that the directories containing the SQL files are in the "Included Locations".

Unfortunately, Windows desktop search still fails to find anything in the .SQL files. Other file types such as .cs, .docx etc are searched successfully.

I'm running Windows XP SP2 - and it's a work machine where I can't easily install alternative search engines so I'm stuck with Windows Desktop search for indexed searching.

Obviously I can search the .SQL files using other (non-indexed) techniques, but I prefer the speed of Desktop Search - if I could get it to work.

Update: Having copied a couple of .SQL files to .SQL.TXT files in the same directory as suggested by ~quack, added .SQL.TXT as a file extension to the indexing options (using the plain text filter, with "Index Properties and File Contents" selected) and re-indexing, Desktop Search still fails to find strings in either the .SQL or .SQL.TXT files.

Additional info: after re-indexing, I checked the file types in the Desktop Search advanced options and noted that the .SQL.TXT file extension no longer appears in the list of file types.

1

4 Answers 4

4

This might not be relevant, but for things like this I really like using the command-line. It's really quick and allows you to specify regular expressions and other features like matching the beginning (or end) of a line.

  • Hold down shift, and right-click the directory you want to search
  • Choose 'Open Command Window Here'
  • Type findstr "order by" *.sql
  • If you want to search sub-directories also, just use findstr /S "order by" *.sql

This will return all files named *.sql with the string "order by" in them. There are lots of command line switches to include things like line numbers, just type findstr /?

2
  • 1
    This is exactly how I've solved this inadequacy of the GUI search, even though most of the time I'm using findstr /m since the file content doesn't usually format that nice on the cmd window.
    – zagrimsan
    Aug 11, 2016 at 9:41
  • This is a nice solution, but works slowly on large directories with lots of files. Any advice for speeding it up?
    – Jautis
    May 19, 2022 at 17:42
3

This would obviously be suboptimal, but have you tried copying the .SQL files to .TXT files?

I don't mean simply rename, since you are presumably using the SQL files as SQL files somewhere. But if you have the space, make copies and rename those to .SQL.TXT or so. If your SQL files change frequently, schedule a task to re-create the copies.

This would be worthwhile as an experiment -- if Windows Desktop Search can successfully index a .SQL.TXT file, there's something about the .SQL extension that it's failing on. If it can't, something about the file's format is confusing it.

2
  • That's a good idea - I'll try a copying just a couple of files to .SQL.TXT and see if Desktop Search finds things within them... Dec 2, 2009 at 14:17
  • 1
    Interesting: having copied a couple of .SQL files into .SQL.TXT file AND rebuilt the indices, Desktop Search STILL fails to find strings within these files. As a desperate measure, I've added .SQL.TXT as a file extension to the indexing options - now I have to wait a few more hours to re-index... Dec 2, 2009 at 23:28
1

Just use Qytec's free Portable File Seeker instead of Windows Desktop Search. It can successfully search within files with provided extensions. You don't need to install it since it's portable. I tried it on my .SQL files and it works without any problems. Here is a screeny from my PC:

alt text

2
  • Sorry - I should have been clearer regarding installation of other search engines: as it's a work machine I can't USE anything other than the tools already provided on the machine. Dec 2, 2009 at 14:14
  • So good luck with WDS. Dec 2, 2009 at 14:30
0

I think (but I'm not sure) you'll need to install an iFilter for SQL into the Windows Desktop Search engine. Take a look here.

1
  • Thanks, but there's no iFilter specific to SQL files - and to be honest I wouldn't expect to find one, as .SQL files are plain text files. Dec 2, 2009 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .