Exactly what I did, but the copy permission was not there 🙂
SpringTownDBA (10/1/2012)
Sql server should have permissions to copy the file, so xp_cmdshell.My approach for moving databases:
1. Alter DB set single_user rollback immediate
2. Alter db set offline
3. xp_cmdshell to copy mdf/ldf to new location, if error, goto 6.
4. xp_cmdshell to rename old files from data.mdf to data_old.mdf
5. Alter DB to point to files on new drive.
6. Alter db set online
7. Alter db set multi_user
Online Trainer For SQL DBA and Developer @RedBushTechnologies with 18 yrs exp.