I've done it once on my current tank. Wasn't by choice, but tank developed a small leak after I had the tank up for about 6 months. I removed everything, sand and all, repaired the seals and then put it all back with a new scape.I even re-used the sand since it was only 6 months old and didn't have to much issues with a cycle. I put rock, corals and fish in a 30g, that I hooked up to the existing sump, and put the sand in a 10g with a heater. Everything lived, corals and all, although at the time I only had a few indestructible corals and a couple hearty fish, but they lived and I still have them.
Now that the tank is several years old I wouldn't consider it unless it was a dire emergency, as I would have to frag or remove most of my colonies and basically start over.
So I would say that it can be done, especially if the tank is newer, but the older the tank, and the more stuff you have it in it, will increase the likely hood of losing most, or all of it.