• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Dynamic SQL Monitoring in SQL Server

I  need monitoring script or tool which only monitors dynamic sql statements which may generated thru hibernate or thru various other methods.
I want to see which dynamic sql is more resource intensive.I dont want the ones from the stored procedure.Thanks
2 Solutions
I don't there is any way to monitor only dynamic sql but you could configure SQL Profiler with TSQL events to monitor the statistics (Duration of execution, CPU time, I/O time etc) of your queries including dynamic sql. To limit the size of your trace captured, put appropriate filters in place like application name, database name, login name and if possible hostname etc. SQL Profiler is very easy to use tool. You could find so many articles over net which tell how to use it.
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
For RAM consumption, you can isolate ORM statement from stored procedures calls by using DMV.  For CPU and IO you can use Profiler to identify most consuming statements some of them will be dynamic based and some sp based.  Most of the ORM mappers (hibernate...) usually create inner procedure cache contention since they decrease the ability of the server to reuse plans.  
venk_rAuthor Commented:

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now