简体   繁体   中英

Database already exists even after deleting the database files

I installed a trading software that uses pair specified and gives me details about it. For initiating the software I have to create a database that it uses to store and retrieve information from. Now I have deleted the database(mdf and ldf file) and now when I create it again it shows that database already exists error. Do I have to delete DSN or something? I can do create database using another sql server instance, but I want to do on the same one. I am clueless. Thanks in advance.

The database information is maintained by sql server express. So just deleting the file doesn't remove the database from sql server. You need to detach the database and then your logic should work. Try sql server management studio express 2008. Or try connect to sql server express programmatically and execute sp_detach_db permissions.

Source : MSDN

A Database is not only MDF and LDF files but also a record in the master database. So you should drop this record about your DB using DROP DATABASE command or through MSSQL Enterprise Manager.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM