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 |
ferrethouse
Constraint Violating Yak Guru
352 Posts |
Posted - 2011-12-16 : 12:30:11
|
I'm at wits end trying to find where a troublesome query is being executed from (.NET code, database object, etc.). We have 10 developers on staff and I've asked all of them to stop what they are doing and track down the query and nobody can find it. I'm pretty sure that it is LINQ (based on the way Ignite formats it) so that rules out a database object. Is there a way to not allow SQL Server to execute that query. I'd rather have a component of our application break temporarily in order to find out where it is coming from.I've used profiler to try to isolate when it happens but it doesn't reveal any useful patterns. It does happen several hundred times per hour but it hasn't been useful for know what is executing it. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
X002548
Not Just a Number
15586 Posts |
|
Kristen
Test
22859 Posts |
Posted - 2011-12-18 : 23:38:27
|
quote: Originally posted by ferrethouse I've used profiler to try to isolate when it happens but it doesn't reveal any useful patterns.
Might be worth looking at the SPID when you find an execution in Profiler, and then what that SPID was doing immediately before/after - if the application executes something else that includes the offending code then the other activity on that SPID would help you track it down.Does all the database access in the application go through a single function? (our does ...) if so that might be a place (or relatively "few places") to trap it. |
 |
|
ferrethouse
Constraint Violating Yak Guru
352 Posts |
Posted - 2011-12-20 : 18:17:10
|
Thanks for the feedback. Everything comes from the same application unfortunately (a web app). One of our developers did manage to track it down by using the profiler and some serious detective work. Of course, that was only after I offered a 500 gig hard drive to the person able to find it ;) |
 |
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2011-12-20 : 19:20:44
|
OR.... Issue a KILL on that spid and listen for who starts to howl. Just a thought.=======================================Faced with the choice between changing one's mind and proving that there is no need to do so, almost everyone gets busy on the proof. -John Kenneth Galbraith |
 |
|
|
|
|