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.
| Author |
Topic |
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2004-08-03 : 15:38:14
|
| I am trying to connect a SQL server Agent and SQL Profiler.Here is what I am trying to do:If the usage of CPU reaches certain level (i.e. 60%), it will trigger a SQL agent and the SQL agent will run the SQL profiler and dump the necessary information( cpu, indexe id, sql, sp, duration, NT user name,lock,etc,…) into a table automatically, so I can analyze the problem later on.Has anyone done this at work? How can I implement this? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-08-03 : 16:20:36
|
| You could do this with Performance Monitor. You would setup an alert that watches for 60% (although this seems a bit low as 60% isn't yet a performance problem), then the alert would launch SQL Profiler.Tara |
 |
|
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2004-08-03 : 17:17:07
|
| How to make an alter launch to Profiler?Should I use the OSQL? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-08-03 : 17:21:01
|
| Yes you would use OSQL and launch SQL Profiler through the extended stored procedures.Tara |
 |
|
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2004-08-03 : 18:25:42
|
| Thanks!Is there any examples that I can take a look at it? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-08-03 : 18:30:06
|
| You would use sp_trace_create. The downside is that you can only trace to a file. Bill Graziano has a utility that allows you to pull those files into tables. Check out the SQLTeam weblogs for that utility.Tara |
 |
|
|
|
|
|