as title itself is saying what i am looking for over here. I formatted my pc and installed Sql server 2005. I detached db before formating the system and attached after formating. however after attaching i am getting Db in recovery/ readonly in object explorer. I tried to change properties the folder and files but it did not worked. setting Read_Write permission using sql command did not worked. even i am not able to detach and delete the db. So plz tell me some useful solution for the same.

Try executing this

ALTER DATABASE MyDatabaseName SET READ_WRITE

If that doesn't work then try

ALTER DATABASE MyDatabaseName SET READ_WRITE WITH ROLLBACK IMMEDIATE
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.