USE master;
SELECT file_id, name as [logical_file_name], physical_name from sys.database_files
ALTER DATABASE DBNAME MODIFY FILE (name='logical_name', filename='D:\Database\physical_name.mdf');
ALTER DATABASE DBNAME SET OFFLINE WITH ROLLBACK IMMEDIATE;
ALTER DATABASE DBNAME SET ONLINE;