Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 exist 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.

like image 289
reinierpost Avatar asked Nov 06 '22 14:11

reinierpost


1 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

like image 131
Joel Martinez Avatar answered Nov 15 '22 11:11

Joel Martinez