我出于某种原因创建了一个数据库,在我使用“删除数据库”命令删除之后,我需要删除该数据库-现在,当我尝试使用Management Studio创建数据库时-我收到错误消息:
然后我遇到以下错误:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Create failed for Database 'IMSFullProdCopy'. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.6000.34+((KJ_SP3).140819-1214+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+Database&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Cannot create file 'E:\Data\IMSFullProdCopy.mdf' because it already exists. Change the file path or the file name, and retry the operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (Microsoft SQL Server, Error: 5170)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=13.00.4522&EvtSrc=MSSQLServer&EvtID=5170&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
创建数据库后,我要运行以下脚本:
use master;
--kill connections
ALTER DATABASE IMSFullProdCopy SET SINGLE_USER WITH ROLLBACK IMMEDIATE
--Restore
RESTORE DATABASE IMSFullProdCopy
FROM DISK =
'C:\Users\sa_aaleem\SomeBakcup\IMSFullCopy_20191224.bak'
WITH MOVE 'IMSFullProdCopy' TO 'E:\Data\IMSFullProdCopy.mdf',
MOVE 'IMSFullProdCopy_log' TO 'F:\Log\IMSFullProdCopy.ldf',
STATS = 1, REPLACE
GO
对此有任何帮助-谢谢。