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
Who is Participating?
sachitjainConnect With a Mentor Commented:
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 BOUDJAKDJIConnect With a Mentor Database 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:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.