SQL 2012 Express, sqlcmd, Restore Database, user tables not restored.
Posted on 2014-03-02
I have a script running sqlcmd to restore a database. It does not restore user tables, but does not give any errors. If I restore from the Management Studio, it works. Any idea what I am doing wrong?
Below is the syntax and the message:
RESTORE DATABASE PGMS
FROM DISK = '\\SVR04\SVR04C\Backups\SVR04Apps\SQLSVR04.bak'
MOVE 'master' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\PGMS.mdf',
MOVE 'mastlog' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\PGMS.LDF',
Processed 424 pages for database 'PGMS', file 'master' on file 1.
Processed 3 pages for database 'PGMS', file 'mastlog' on file 1.
RESTORE DATABASE successfully processed 427 pages in 0.168 seconds (19.816 MB/sec).