Thursday, September 05, 2013

Sanchay Post Cannot Connect to Database

Error:Cannot connect to BPRO Database



Database 'BPRO' cannot be opened due to inaccessible files or insufficient memory or disk space. See SQL Server errorlog for details.

Solution:
 1. Run Below query step by step in SQL query analyzer.







 2.  Execute  First Two queries then Goto final.

 3. Final One query may Getting error. So try to run twice/thrice.  


check the DB status, most of the time , it will return 1
use master
select databaseproperty('dbname','isShutdown')

Change the database to offline to clear the database status 
use master
alter database dbname set offline

Now change the database to online, at this step log file and data files will be verified by sql server
use master
alter database dbname set online