Tools for listing database accesses from .NET code
I've been handed a C# codebase that uses a SQL Server 2005 database. I would like to have an overview which database tables and procedures are accessed by which method bodies in the code; in the case of tables, I would also like to know the type of access (CREATE, DROP, SELECT, INSERT, UPDATE or DELETE). String searching for these keywords and table/procedure names would get me a long way except that the code makes very little use of bare SQL, mostly using DataSets and DataAdapters and who knows what else.
This is not the first time I've been in this situation (with varying languages and DBMSes).
Which tools exi开发者_StackOverflowst to help me with this task? Can you recommend an improvement on my string searching idea?
PS: There is another question on SQL Server dependencies with some relevant answers.
sql server profiler. it will log every single call along with the procedure text ... and then you can export the profile trace to a table and query upon it :-)
http://msdn.microsoft.com/en-us/library/ms187929.aspx
精彩评论