home
training courses
why choose us?
solutions
support
company
LearnItFirst User Forum
Welcome Guest
Search
|
New Posts
|
Members
|
Log In
|
Register
SQL Server Forum - LearnItFirst.com
»
SQL Server Scripts, Code Samples and SSMS Custom Reports
»
All SQL Server Versions
»
How to View the Cached Query Plans (SQL 2000)
How to View the Cached Query Plans (SQL 2000)
Options
Previous Topic
·
Next Topic
Scott Whigham
Posted:
Sunday, October 01, 2006 8:27:46 PM
Rank: Super Mod
Joined: 3/20/2006
Posts: 460
Points: 1,002
Where do you live?: Dallas, TX
I was rummaging through my scripts tonight and found this oldie:
Code:
SELECT cast(C.sql as Char(100)) as Query, cacheobjtype, usecounts
FROM Master.dbo.syscacheobjects C
JOIN Master.dbo.sysdatabases D
ON C.dbid = C.dbid
WHERE D.Name = DB_Name()
AND ObjType = 'Adhoc'
ORDER BY Query
This is really more for SQL Server 2000 but might be helpful for anyone, I suppose. It shows you the cached plans and how many times they've been used.
Back to top
Users browsing this topic
Guest
Forum Jump
SQL Server Database Administration
- General SQL Database Question & Answer
- Backup, Recovery and Disaster Recovery
- SQL Server Security
- Integration Services (SSIS) and DTS
Transact-SQL Programming
- DML (SELECT, INSERT, UPDATE, DELETE) Questions
- Stored Procedures, Triggers, & Functions
SQL Server Scripts, Code Samples and SSMS Custom Reports
- All SQL Server Versions
- SQL Server 2005/2008
- SQL Server Management Studio Custom Reports
Customer Service
- Video Requests
You
cannot
post new topics in this forum.
You
cannot
reply to topics in this forum.
You
cannot
delete your posts in this forum.
You
cannot
edit your posts in this forum.
You
cannot
create polls in this forum.
You
cannot
vote in polls in this forum.
SQL Server 2005 DBA Training Videos
SQL Server 2008 DBA Training Videos
Watch this topic
RSS Feed
Email this topic
Print this topic
Threaded
Normal