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'

  • 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