Hi,
We are use custome action to restore sql database and we put the sqlcmd
Command as the following:
SQLCMD -E -S .\sqlexpress_2 -i RestoreMasterDB.sql -v mPath=[TempFolder]
[TempFolder] is the temporary folder in the windows volume that contains the MasterDB.Bak
And We us the sql script file to run the restore script which contains the following script:
RESTORE DATABASE MasterDB
FROM DISK = '$(mPath)\MasterDB.bak'
WITH MOVE 'SecurityDB' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS_2\MSSQL\DATA\MasterDB.mdf',
MOVE 'SecurityDB_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS_2\MSSQL\DATA\MasterDB_log.ldf'
But the following error message shown
“{SQL_ERROR}: {SQL_STATE: 42000} Cannot open backup device c:\Program Files\
Microsoft SQL Server\MSSQL10.SQLEXPRESS_2\MSSQL\Backup\$(mPath)\MasterDB.Bak
Operating System Error 3 (failed to retrieve text for this error. Reason: 15105).”
See the attached image for more info.
Please help me to solve this issue.
Thanks
FOLLOW US
Get the latest news in Application Packaging