Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to analyze/access SQL statements in Database

Author  Topic 

pandara
Starting Member

1 Post

Posted - 2011-06-20 : 17:50:40
What are steps that I have to take in order to gain access to SQL statements and stored procedures that are contained within a database?

What I want to do is analyze the statements and figure out the fields and tables being used in the SQL statements and store that information within a separate database. For example: the field ‘gender’ in table ‘humans’ is used 15 times by 15 different SQL statements.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-06-20 : 17:52:17
You can run a trace to capture all queries.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-06-20 : 21:59:37
Also look at SYS.DM_DB_INDEX_USAGE_STATS.
Go to Top of Page
   

- Advertisement -