I installed a SQL Server 2008 on a machine and created a database on it. Subsequently, the machine that this was installed on was added to a Windows domain and it appears the original local user account that Server Server was install on was renamed or deleted. Now, I'm unable to connect to the database using a domain administrator, newly created local administrator account, or the local system account. When I attempt to expand the database in SQL Server Management Studio I get the error "The database is not accessible. (Object Explorer)". Is there any way I can get access to the database? I want to somehow just make a copy of the .mdf file and recreate it in Management Studio and then just overwrite the newly created one with the copy but I suspect this will maintain the permission issues that I have now. Any ideas are welcome.
Log into Windows with the old username, but prefix it with the computer's name.
If that doesn't work, let us know and we can help with the next step.
If you can connect to the SQL instance, can you do so as Administrator? If so, all you have to do is change the owner of the DB. Right-click on the database, go to Properties, then Files, and change the owner there.
|show 10 more comments|