Hi All I need to capture T-SQLs and transactions that run on SQL Server DB. How do I capture this information into table? Thanks in Advance...
I knew that i can view in profiler for specific db, event etc....But transfer in table for analysis? Thanks....
I can't follow you. If you need Profiler trace into a table just select table instead file, to store all information.
Ok now it is clear, see when you open PROFILER and connect to the server you can see templates: Standard (default) by clicking on event selection you can see what kind of events are captured, same way you have templates for TSQL_duration, TSQL_Sps & SP_counts and once you choose relevant template you can store in a table where the information can be used to query the trace information as required by you such as between the dates etc. Also you can go thru Brad's ebook on mastering profiler: http://www.red-gate.com/products/SQL_Response/offers/Mastering Profiler eBook.pdf a must one for every DBA.
On a sidenote: Depending on how busy that server already is you may increase the load considerably and may collect large amounts of data.
Well... thanks all of you ....Satya I have download the book and found really solid on the subject. Thanks Once again....
I am wondering that is there any DMV that give us occurrence of different statements on the server for DBs. I have found one ....but not sure if this will help correctly.... Select * from sys.dm_exec_query_optimizer_info where counter in ('optimizations','elapsed time','trivial plan','tables','insert stmt','update stmt','delete stmt') It give us info all DBs exist on a Instance. If this is correct then how come I can get occurrences on Select statement in similiar way? Thanks in Advance
Sonny Your question is not clear enough, if it is not related to this thread please start a new post.
Sonny Your question is vague in terms of providing a reply is not simple, as Luis suggested you can take help of Profiler and store the trace information to a table for query purpose. See http://msdn.microsoft.com/en-us/library/ff650699.aspx on using profiler and this SSP article on http://www.sql-server-performance.com/tips/index_tuning_wizard_p1.aspx index tuning wizard once your trace is completed.
Ok, let me elaborate the need... I need to capture number of T-SQLs (sps, functions, triggers, single T-SQLs) hits on the databases exist on a server in a day for week. How can I do it. I have tried and also read the articles (and couple of others) but didn't succeeded. That' why I have asked this question... A small example would be great help. Thanks in Advance
Run a trace using SQL profiler and make it record data into a table. set the trace to run in all databases on the server. hope that helps
Ok, let me elaborate the need... I need to capture number of T-SQLs (sps, functions, triggers, single T-SQLs) hits on the databases exist on a server in a day for week. How can I do it. I have tried and also read the articles (and couple of others) but didn't succeeded. That' why I have asked this question...A small example would be great help. Thanks in Advance