SQL Data input "echoing"
I have a C# program that reads data from a SQL server instance using ADO.N开发者_如何学Cet. What I'd like to be able to do is hook-up a module that will echo any input data read from the database while the program is running to an empty database with the same schema. This would allow a minimal data set to be created dynamically for that particular run of the program, which could then be used as a regression test of the program (often times databases can be pretty big, say 50GB, but only a few hundred megabytes of data are what we care about for a particular run, so this would help trim down the input considerably). On the surface this seems pretty simple, but then you get into issues like how to deal with views versus tables, how to handle different filters that may overlap, etc. Does anyone know any open-source or Microsoft-related products/tools that can help with this task? Thanks.
For a long time and permanent data 'echo' solution use Transactional Replication.
For a short term solution, more appropriate for testing, use SQL Profiler's Replay option, see How to: Replay a Trace File (SQL Server Profiler).
精彩评论