I love SQL Server Management Studio's 'Find in files' capability -- searching specific file types along multiple pre-defined paths for specified strings. (I have a PERL-driven ASCII editor which does something very similar.) But I am needing a batch process to execute the same sort of argument-rich search for many MANY DIFFERENT strings. I had assumed that once I ran a preliminary search, the query windows would provide (along with the search results) the SQL query syntax executed to produce that search -- which I could then use as a template for creating a complex query or batch search. I see now that this 'Find-in-files' capability in Management Studio isn't a SQL query at all, but a process apparently internal to the software itself. I'm an avid SQL user, but not really a SQL programmer. Does anyone have a simple approach to accomplishing this sort of search in a 'scalable' SQL query?
Asked
Active
Viewed 708 times
0
-
Thanks, Tony. The capability I'm after would exist in other venues, by other methods, but it would be very helpful for me to do this in SQL Server. (I'm not working in Unix, or Unix emulation. And Windows' CMD isn't very versatile or even 'Windows-friendly', ironically.) I've written and/or adapted hundreds of SQL scripts/queries successfully, but still learning. I'd think a small SELECT query with recursive/nested arguments using the directory string and SQL or system variables for the file search would do it. I don't know the language well enough to write it. (MSDNs Library isn't helping.) – Barry May 14 '12 at 16:28
-
Discovered a bit of relevant GREP vs. SQL content here, but still not what I need: "http://stackoverflow.com/questions/5927241/what-is-generally-faster-grepping-through-files-or-running-a-sql-like-x-query" – Barry May 14 '12 at 19:45
-
BTW, it's local ASCII string content that I'm needing to mine (not file names). – Barry May 14 '12 at 19:54
-
As a learning exersise it's fine, but you wouldn't usually Create and populate a database to do just something like this. If you were doing it anyway, for other reasons then it makes sense. – Tony Hopkinson May 15 '12 at 14:55