Comments
2 comments
-
One or more users were using that database at the time of the restore. Run sp_who or sp_who2 to see who's using the database. -
Huh... no, any user on the database... but I solve the problem.DECLARE @exitcode int DECLARE @sqlerrorcode int exec master..sqlbackup N'-SQL "RESTORE DATABASE [DB2] FROM DISK = ''P:\backup\DB1.sqb'' WITH RECOVERY, MOVE ''DB1'' TO ''E:\MSSQL\Data\DB2.mdf'', MOVE ''DB1_log'' TO ''E:\MSSQL\Data\DB2_log.ldf'', REPLACE"', @exitcode OUTPUT, @sqlerrorcode OUTPUT SELECT @exitcode returnExitCode, @sqlerrorcode returnSQLErrorCode
and that's right.. :roll:
thx
Add comment
Please sign in to leave a comment.
p:\backup\DB1.sqb is ok.
and outpout file return :
can you help me?
thanks