开发者

Search multiple SDF files

开发者 https://www.devze.com 2023-03-03 05:32 出处:网络
I have a process that backs up my remove SQL Server database to local SDF (SQL CE) database files daily.

I have a process that backs up my remove SQL Server database to local SDF (SQL CE) database files daily.

What I need is an easy way to search across multiple SDF files. For example, suppose I want to find all occurrences of a name within all of the backups. Instead of opening each individual SDF file -- one by one -- with Enterprise Manager, I'd like to be able to do a search across all the files and show the results in one central开发者_Go百科ized place. Maybe like a plug-in for Windows Search, etc.

If you're familiar with Notepad++, think about how it's File Search feature works.

Is there any way to accomplish this, or am I just dreaming?


There is no direct way to accomplish this, unless yo write your own search filter for SQL Server Compact. But you could use a tool like my SQL Server Command command line utility http://sqlcecmd.codeplex.com together with some clever batch/Powershell code to query across multiple sdf file and collect the results in a singel file.


You could write a script or program that opens/connects to a set of .SDFs (all files in a folder, from a hardcoded list, from a table in a specialized/master ..SDF), execute a (list of) statement(s) like SELECT ... FROM table WHERE field = 'needle', and display the resultsets to the console, a .HTML file, or push them to still another .SDF.

0

精彩评论

暂无评论...
验证码 换一张
取 消