cancel
Showing results for 
Search instead for 
Did you mean: 

SQL SEREVR CONNECTION TO LOCAL DATABASE FAILED ,help!!

Former Member
0 Kudos

Hai,

I detached my dev database from sql server 2000 enterprise manager and then i replaced my old data files mdf,ndf and ldf with the new once on the same location. now when i start sql server it is not showing any of databases , i also registered the sql server again and it gives me mesage can't connect to database login failed.

i think there must be some password at db level which is causing problem.

if i have to change the old password at this stage what should i do??

hope i find some solution

regards

jase

Accepted Solutions (0)

Answers (2)

Answers (2)

clas_hortien
Employee
Employee
0 Kudos

Hi,

you must logon with another user. Use a local admin. Logon on Windows with another local admin and connect to your SQl Server. Once you are connected attach the database again. Then you are able to connect via sidadm again.

The root cause is, that the default database of the sidadm is detached, so the sidadm cannot log on.

A second way can be to use the osql.exe tool. Open a command promt and run

osql -E -dmaster

This should you connect to the default instance of the server and switch to the master database, Then you can run

exec sp_defaultdb '<sid>adm','master'

go

Then you should be able to logon as sidadm as well.

regards

Clas

Former Member
0 Kudos

Hi Jase,

I suppose this what you did: right click on database -> All tasks -> Detach database

Then you copied the files to the new location. Now open the Management Studio and right click on 'Databases' -> All Tasks -> Attach Database...

The following dialog asks you for the .MDF file. Just follow the steps. Then your new DB should be attached to that instance.

Concerning DB-Users and so on check SAP NOTE 610640. Make sure that you have a look at Books Online for the Stored Procedures sp_detach_db and sp_attach_db.

Regards,

Sven