Restore / Create a database with a data file (MDF) from backup the same but with two data files (MDF and NDF) I must restore/create a db (in a new instance) in one file(mdf) from a backup of the same but with two files of data (mdf and ndf)

How can I do it?



This is what I try... but it did not work

    RESTORE database mydb
    FROM  DISK='\\150.10.10.12\backup\mydb.bak' 
    WITH  REPLACE, RECOVERY, 
    MOVE 'Mydb_DATOS'       TO 'F:\MSSQL\Data\Mydb.mdf', 
    MOVE 'Mydb_REGISTRO'    TO 'G:\MSSQL\LOG\Mydb_LOG.ldf'


then check the following

 RESTORE FILELISTONLY 
 DISK='\\150.10.10.12\backup\mydb.bak'
You need to include the .NDF file in your restore script.


 RESTORE DATABASE mydb
    FROM  DISK='\\150.10.10.12\backup\mydb.bak' 
    WITH  
        REPLACE
      , RECOVERY
      , MOVE 'IMAGENES_Data' TO 'F:\MSSQL\Data\Mydb.mdf'
      , MOVE 'IMAGENES'      TO 'F:\MSSQL\Data\Mydb.ndf' 
      , MOVE 'IMAGENES_Log'  TO 'G:\MSSQL\LOG\Mydb_LOG.ldf';