"Sql server error 5120" while attaching database

  • I ran Sql Server Management Studio as Administrator and used the usual steps and it worked for me.

    Brij Kishore Sharma
    Solution Rally

  • dotnet-786228 (6/18/2008)


    Hello !!!

    try login with Windows Authentication.

    Gala;)

    This solved my problem.

  • 1) you check which login credential Windows/user

    go windows with adminisrator

    2) even you face prob

    take bakup and resotre the best way

  • Thank you!!

    It worked out for me when i logged in using Windows Authentication.

  • copy your both mdf and ldf files to the default database folder of the sql server edition. for 2010 express edition u need to copy it to C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\. Then try to attach the db, it may work.

    Thanks...

  • Moving the mdf/ldf files worked for me (Nutshell.mdf for LinqPad examples).

    C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA

    Note I do have a MSSQL11.SQLEXPRESS folder but no MSSQL\DATA in it.

    Gary Davis

  • It worked out for me when i logged in using Windows Authentication, too 🙂

    With that Administrators run it was not working for me. :hehe:

    Thank you 🙂

    One more advice > If you can not connect to your database through network - check, that you have IIS installed + enable TCP/IP through "SQL server configuration manager" - SQL server 2005 Network configuration - Protocols for MSSQLSERVER.

    Have a nice day :w00t:

  • thats true thanks cuz I try anything but dosen't work but ur solution is great !

  • I had this error when trying to attach a db on my SQL Server 2012 instance connected using Windows credentials. What fixed the problem was giving full control of the mdf and ldf files to this user.

    Right click the folder containing mdf and ldf files, Go to Properties --> Security tab --> Edit --> Scroll down to the user and select Allow under full control permissions --> Click Apply.

  • Worked like a charm.

    Thanks for the post mate, Had seen lot of websites for the solution and I'm done with quite number of RnD attempts but never thought the solution would be so simple. Will remember you

  • Thank you Sqlash...:-)

  • Just Go to SQL-Server Configuration

    Change SQL Service Browser Service type to Localservice

    will be done

Viewing 12 posts - 16 through 26 (of 26 total)

You must be logged in to reply to this topic. Login to reply