Device activation error on SQL server
Tuesday, February 26, 2013
Sometime when you're trying to restore a sql server database from a different server using SQL management studio, you'll get this error
Device activation error
This is usually caused by the original database which is in the original server, which may consist of several data files (.mdf), requires the same file location in the new server.
However, this can be resolved by running this command in the SQL management studio.
First check total files in the backup by using this query
RESTORE FILELISTONLY FROM DISK='F:\SQLbackup\myDatabase.BAK'
Based on the result, run the following query
RESTORE database SelfService2 FROM disk='F:\SQLbackup\myDatabase.BAK'
with replace,
move 'myDatabase_Data' to 'F:\SQLData\myDatabase_Data.mdf',
move 'myDatabase_Log' to 'F:\SQLData\myDatabase_Log.mdf'
Make sure the new path of database with it name does not exist in that particular path
0 comments:
Post a Comment