Заметки сисадмина » SQL Move multiple databases from C: to D: at once

Заметки сисадмина о интересных вещах из мира IT, инструкции и рецензии. Настраиваем Компьютеры/Сервера/1С/SIP-телефонию в Москве

SQL Move multiple databases from C: to D: at once

2021-12-30 · Posted in SQL

I have SQL Server 2008 R2 with 323 databases consuming some 14 GB on my C: drive, a fast SSD.
Because I want to reclaim some space on my C: drive, I would like to move them to my D: drive.
I have found this MSDN article, but that seems to be the procedure to move only one database.
Is there an automatic way or script to move all my databases at once?

This script will return a batch of statements that you can run:

Leave a Reply