c# - DB backup is not being restored to another DB. It is showing "Specified cast is not valid" error -
i have been experiencing "specified cast not valid" error while restoring backup of db. version of sql server management tool taking backup "microsoft sql server 2008 r2 (sp1) - 10.50.2500.0 (intel x86) jun 17 2011 00:57:23 copyright (c) microsoft corporation express edition advanced services on windows nt 6.1 (build 7601: service pack 1) (wow64) (hypervisor) ". , restoring same version tool.
i have tried suggested solutions mentioned on other posts not work me.
- i have tried creating mdf , ldf files , attached them local db.
- i have tried generate script this.
- i have tried updating sql management tool 2012 r2 doesn't work.
is there other solution issue resolved?
that seems common error when restoring via ssms. assuming did, can work around issue restoring via tsql.
- grab backup file details via "restore filelistonly disk = n''"
- build restore command proper move option.
final restore command should this:
restore database [mydb] disk = n'c:\backup\mydb.bak' move n'mydb_data' n'd:\data\mydb.mdf' , move n'mydb_log' n'e:\log\mydb_log.ldf' , replace
Comments
Post a Comment