Home Forums SQL Server 2008 SQL Server 2008 - General Cannot open database “” requested by the login. The login failed. Login failed for user 'sa' RE: Cannot open database “” requested by the login. The login failed. Login failed for user 'sa'

  • master.huricane (2/25/2013)


    AndrewSQLDBA (2/25/2013)


    You can try renaming the database database

    EXEC sp_renamedb 'oldName', 'newName'

    Or you can detach it and attach it again, giving it a new name and a new location on the drive. I never place any database file in the same directory as all the SQL binaries. I create directories on separate drives, place the data file on one, and the log file on another.

    EXEC sp_detach_db 'oldName', 'true'

    EXEC sp_attach_db

    @dbname = N'newName',

    @filename1 = N'<Full Path to the Data File>.mdf',

    @filename2 = N'<Full Path to the Log File>.ldf'

    Andrew SQLDBA

    Thanks,i renamed it but the problem still exists .just like how its in the video clip i took and posted in my last post,would you have a look at it and see if it conveys anything?

    Thank you very much 🙂

    After renaming the database i needed to restart the SSMS and then specify the sa default database again (since after renaming it was lost and sa was pointing to nothing ) i specified the default database as dbNegin and all started working again 🙂

    Thank you very much .

    🙂