In questo esempio viene illustrato come ripristinare in nuove posizioni nell'unità D: due file del database MyNwind originariamente memorizzati nell'unità C:. Verranno inoltre applicati due log delle transazioni per ripristinare il database all'ora corrente. L'istruzione RESTORE FILELISTONLY viene utilizzata per stabilire il numero e i nomi logici e fisici dei file del database da ripristinare.
USE master
GO
-- First determine the number and names of the files in the backup.
RESTORE FILELISTONLY
FROM MyNwind_1
-- Restore the files for MyNwind.
RESTORE DATABASE MyNwind
FROM MyNwind_1
WITH NORECOVERY,
MOVE 'MyNwind_data_1' TO 'D:\MyData\MyNwind_data_1.mdf',
MOVE 'MyNwind_data_2' TO 'D:\MyData\MyNwind_data_2.ndf'
GO
-- Apply the first transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH NORECOVERY
GO
-- Apply the last transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log2
WITH RECOVERY
GO