• Thanks for your support Lowell.

    I executed your script and tested. I found few issues and I have attached, can you please check. I am using SQL Server 2005.

    thanks in advance.