Could you please refer to the article listed below and let me know if this helps?
Regards,
Kent
http://www.mssqltips.com/tip.asp?tip=1853
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/