Statement: I now in Jiangsu Province Taicang a company to work, the content of this blog is only representative of my views, not on behalf of the company, only
Only some technology sharing, if there is conflict with the company's privacy technology, I will dispose of, but also thank the company to give me the opportunity, industry
Yu on the Internet to write some technical articles, I will cherish the current job opportunities, and strive to repay the company, the return of their families.
Microsoft SQL Server Management studio--> Object Explorer--database
Two methods:
1. Right-click Delete
2.drop Database dbname
The following error occurred while deleting "cannot delete * * database, the database is currently in use"
ALTER DATABASE dbname set offline with rollback immediate
or select Disconnect
After you do this, the operation is deleted normally.
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/83/29/wKiom1dr4JCxdTWVAAEfUl7YOdQ712.jpg-wh_500x0-wm_3 -wmp_4-s_2056837101.jpg "title=" 2016-06-22_092054.jpg "style=" Float:none; "alt=" Wkiom1dr4jcxdtwvaaeful7yodq712.jpg-wh_50 "/>
For example, click OK can be deleted, if the execution error, you can select the Figure 2, Close existing connecting.
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/83/28/wKioL1dr4I6gSmSaAAIWU470Wu0872.jpg-wh_500x0-wm_3 -wmp_4-s_3679250279.jpg "style=" Float:none; "title=" 2016-06-22_091959.jpg "alt=" Wkiol1dr4i6gsmsaaaiwu470wu0872.jpg-wh_50 "/>
You can also click Script to view the delete T-SQL that deleted the database.
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/83/28/wKioL1dr4JCiFMMEAAFOqVwzo4M299.jpg-wh_500x0-wm_3 -wmp_4-s_2393227069.jpg "style=" Float:none; "title=" 2016-06-22_092103.jpg "alt=" Wkiol1dr4jcifmmeaafoqvwzo4m299.jpg-wh_50 "/>
You can see the script.
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/83/28/wKioL1dr4JLQ_57xAAM2c3bhYkc922.jpg-wh_500x0-wm_3 -wmp_4-s_1809662311.jpg "style=" Float:none; "title=" 2016-06-22_092131.jpg "alt=" wkiol1dr4jlq_ 57xaam2c3bhykc922.jpg-wh_50 "/>
This article is from "Hangzhou Technology blog" blog, please be sure to keep this source http://hangyc.blog.51cto.com/427521/1792351
How SQL Server 2012 deletes a database