Lately, I'm dealing with lots of DB migrations and came across situation that I have no proper dynamic script to move DB files to different location.
There are an option to proceed manually scripting one by one DB and execute it. Another option is detach attach DB - I'm not a big fan of this kind of operation, I assume DBAs understand why.
As we all do, I search on the net and didn't find anything that could answer my needs.
So I wrote one and here it is.
there is nothing complicated and you can merely see the output and then copy/paste for execution.
it also includes OFFLINE/ONLINE DB script which is necessary for this kind of operation.
If you find any bug, please let me know.