本文介紹了無法刪除 SQL Server 2012 中的數據庫的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
我之前創建了一個示例數據庫,現在我想刪除該數據庫,但它沒有被刪除.我在網上搜索,但沒有找到任何有效的解決方案.
I have created a sample database earlier and now I want to delete that database, but it is not getting deleted. I searched online but I didn't find any solution which is working.
使用 T-SQL,我嘗試過:
Using T-SQL, I tried:
USE [Sample]
ALTER DATABASE [Sample]
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE;
GO
DROP DATABASE [Sample]
使用 GUI,我收到以下錯誤:
Using the GUI, I am getting this below error:
我關閉了現有的連接,然后這也發生了,這是我的本地機器.請在這里幫助我!
I closed existing connection then also this is happening and this is my local machine. Please help me here!
推薦答案
使用此代碼:
USE MASTER
GO
ALTER DATABASE Sample
SET multi_user WITH ROLLBACK IMMEDIATE
GO
ALTER DATABASE Sample
SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
DROP DATABASE Sample
GO
這篇關于無法刪除 SQL Server 2012 中的數據庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!