Refer to thehttp://www.umachandar.com/technical/SQL6x70Scripts/Main29.htm provided and can define that as a function for future references. Satya SKJ Moderator http://www.SQL-Server-Performance.Com/forum This posting is provided “AS IS†with no rights for the sake of knowledge sharing.