Thursday, July 22, 2010

Execution Count of an SP

To get the number of times an SP has been executed run the following TSQL script :

SELECT DB_NAME(st.dbid) DBName
,OBJECT_SCHEMA_NAME(st.objectid,dbid) SchemaName
,OBJECT_NAME(st.objectid,dbid) StoredProcedure
,max(cp.usecounts) Execution_count
FROM sys.dm_exec_cached_plans cp
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) st
inner join sys.objects sr
on st.objectid = sr.[object_id]
where DB_NAME(st.dbid) is not null and cp.objtype = 'proc' and sr.[type] = 'p'
group by cp.plan_handle, DB_NAME(st.dbid),
OBJECT_SCHEMA_NAME(objectid,st.dbid),
OBJECT_NAME(objectid,st.dbid)
order by max(cp.usecounts) desc


The query above will list down all the SP with their execution count. If you want the execution count only for a particular SP then add a WHERE condition as stated below :



SELECT DB_NAME(st.dbid) DBName
,OBJECT_SCHEMA_NAME(st.objectid,dbid) SchemaName
,OBJECT_NAME(st.objectid,dbid) StoredProcedure
,max(cp.usecounts) Execution_count
FROM sys.dm_exec_cached_plans cp
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) st
inner join sys.objects sr
on st.objectid = sr.[object_id]
where DB_NAME(st.dbid) is not null and cp.objtype = 'proc' and sr.[type] = 'p' and sr.[name] = 'Your_SP_Name'
group by cp.plan_handle, DB_NAME(st.dbid),
OBJECT_SCHEMA_NAME(objectid,st.dbid),
OBJECT_NAME(objectid,st.dbid)



Note:
The execution count given by the above query is from the cache in the SQL server, so it will give the count from the time since last cache clearing took place.

Asp.net menu control is not rendering properly in IE8, instead of displaying menu links in the browser only blank white space is displayed ?

The asp.net menu control is making a bad assumption on what the default value for z-index should be.

To solve this issue add the following code to the
asp.net menu to override the z-index property.

In the style sheet put some large value for the Z-index as shown below
.IE8Fix
{
z-index: 1000;
}

Now add SkipLinkText attribute to the
asp.net menu tag with a null value as shown below.


By making these two changes
asp.net menu will work properly in IE8. ..

Monday, June 28, 2010

Why You Say It

Just finished reading "Why You Say It" by Webb Garrison. I found it fairly interesting and intriguing. The explanations and depictions made in the book are based on facts and have a hint of humour attached to it.
On first look it gives an impression of being a reference book but when you start flipping the pages you will come across the jargons and sayings that you actually use in your daily communication. I actually went ahead to check the historic references illustrated in the book and found them accurate and honest most of the time.
The people who do not have a good command over English language can learn a lot from this book and the people who know the language pretty well can enjoy the way the author describes each and every saying.

Wednesday, January 20, 2010

A person always remains in jeopardy whenever it comes to believing and perceiving. An uneducated man usually believes on anything on display while an educated person is driven by various other parameters.
But in both the case truth remains behind the curtain.