• Great script Vidya!! Thanks for posting this!

    I found the earlier comments from Maurice and JFoster quite helpful as I encountered the same issues.

    I also found that if the exisitng partition existed on a non-Primary filegroup and contained TEXTIMAGE data for varchar(max) or TEXT data types, then the the switching did not working becuase the new table sets TEXTIMAGE to the default filegroup, which was PRIMARY in my scenario.

    So I made some changes to this excellent script to change the default filegroup before creating the mirror table then it worked perfectly.

    In the next post I will submit the modified script including everyones changes thus far and I hope you don't mind us adding these suggestions now, since you are busy currently.

    Cheers

    Chris

    --Chris Hamam

    Life's a beach, then you DIE (Do It Eternally)