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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Plan Cache

Author  Topic 

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2008-11-18 : 19:17:02

We have a very active server and I am looking for rouge code which is changing a single value. the problem is the developers claim they dont have any code touching this table and field.

UPDATE Hiec_tEvents
SET IsAttendLive = 1
WHERE EventID = 164;

I was thinking about having a trigger fire on this table fire when this field value was changed. This way I could capture the active sessions sql statements. Found some great code using dynamic mgt views but UNFORTUNATELY this is SQL 2000.

Can someone help me with getting to the SQL Plans that are in the cache. I am hoping that I can get the user_name(), host_name() and the SQL.

Several suspects: Open SQL in the App, DTS, jobs, and linked servers are all possibilities.

you assistance appreciated.


You can do anything at www.zombo.com

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-11-18 : 19:18:30
A trigger would work for this. In the trigger, capture the various things you have available from the global variables and functions.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2008-11-18 : 19:24:02
LOL
Yea, a trigger
how insightful,

now that Tara has made her mark on the posing, I could actually use some help...
ill restate for those of us actually reading the posts.

"Can someone help me with getting to the SQL Plans that are in the cache"



You can do anything at www.zombo.com
Go to Top of Page

clarkbaker1964
Constraint Violating Yak Guru

428 Posts

Posted - 2008-11-18 : 19:27:32
found it, boy im in a foul mood
;-)
select * from syscacheobjects

You can do anything at www.zombo.com
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-11-19 : 02:31:04
Plan cache wíll not help you here if developer executes a stored procedure which has code to update the table.

EXEC MySP 'Param1', Param2

If the UPDATE is in the MySP procedure, you will not notice.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -