--Note down your old location
SELECT name, physical_name AS OldLocation, state_desc AS OnlineStatus
FROM sys.master_files
WHERE database_id = DB_ID(N'SentryWorklist')
--Tell SQL where the files will be once you bring the DB back online
--Do the Data first
ALTER DATABASE SentryWorklist
MODIFY FILE ( NAME = SentryWorklist,
FILENAME = 'D:\DBs\SentryWorklist.mdf');
GO
--Do the logs next
ALTER DATABASE SentryWorklist
MODIFY FILE ( NAME = SentryWorklist_Log,
FILENAME = 'L:\Logs\SentryWorklist_log.ldf');
--Take the DB where it is now offline
ALTER DATABASE SentryWorklist SET OFFLINE;
--Move the DB Files
--Bring the DB back online
ALTER DATABASE SentryWorklist SET ONLINE;
--If all goes well, this will show you the new location
SELECT name, physical_name AS NewLocation, state_desc AS OnlineStatus
FROM sys.master_files
WHERE database_id = DB_ID(N'SentryWorklist')
GO