SQL Relocate / Move database files

Hello, This is not the most beautiful script I wrote,…