• Thanks for this script - almost exactly what I was looking for. I do have one problem, though:

    I need to run this for 50 very large databases to move the files to a new drive on the same box. Works great for 48, but two of the generated CREATE strings actually are longer than 8000 chars. I set the output in my query window for 8192 text, and declared the @sql variable to (max) but it still will not print anything past the 8000th character. What to do??

    Thanks much for an otherwise excellent script.

    kjt