172 thoughts on “SQL SERVER – FIX : ERROR : Cannot open database requested by the login. The login failed. Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’.

  1. Hi,

    Good to see your blog. It contains a lot of useful info. However, my problem doesn’t get resolved with this article.

    I have a sharepoint server (2007) configured and while setting up the configurations, i started to get this error:

    Login failed for user ‘NT AUTHORITY\LOCAL SERVICE’. [CLIENT: xxx.xxx.xxx.xxx]

    Description: Cannot open database “SharedServices1_DB_8b3d821a-aea9-425d-bac9-87b4b4c1ac70″ requested by the login. The login failed.

    my Shared Service Provider is configured to run under the above account with permissions as you mentioned above in your article.

    • Easiest is to just delete and recreate that SSP if you don’t have any real affinity for that database. You’ll need a domain service account to create it – you can’t use the network service because you have to type in a password when recreating the web application database.

  2. Hi,
    The database is set as ‘standby and read only’ mode because the database being set as log shipping (subscriber). I can’t change as per your recommendation. What should be done before that?
    Thanks.

  3. hi
    when i enter the following command in the command prompt:

    psconfig -cmd standaloneconfig

    four steps pass without any problem. in the step 5 of 10, i get the following error:

    Failed to register SharePoint services.

    An exception of type System.Data.SqlClient.SqlException was thrown. Additional exception information: Cannot open database “SharedServices1_DB_af35e620-5472-42d9-af7a-b78a20caf33e” requested by the login. The login failed.
    Login failed for user ‘TEST\Administrator’.

    since the problem seems to be the same as what u mentioned here, i tried the solution. but, in the User Mapping section of the Login Properties of NT AUTHORITY\NETWORK SERVICE, i couldn’t find SharedServices1_DB_af35e620-5472-42d9-af7a-b78a20caf33e. there are totally 8 items in the list, four disabled:

    master
    model
    msdb
    tempdb

    and four enabled:

    SharedServicesContent_7e…c9
    SharePoint_AdminContent_eb…91
    SharePoint_Config_18…ac
    WSS_Content

    the disabled ones’ db_owner is unchecked and the enabled ones’ db_owner is checked. i mean the role list is disabled or enabled.

    now, what can i do?
    thx

  4. besides, when opening the User Mapping page, Microsoft SQL Server Management Studio pops up an info dialog indicating:

    One or more databases are inaccessible and will not be displayed in the list.

  5. Hi Pinal,

    I have restored a database and I get this error while i try to connect my application to the database. It fails for my application user name and not for NTAuthority.
    Can you suggest what could be the problem.

    Thanks
    Namrata

    • Hi Pinal Dave:

      I downloaded Microsoft SQL Server Management Studio Express and did as you instructed here but I am still getting the following error:

      Cannot open database “AdventureWorksLT” requested by the login. The login failed. Login failed for user

      Thanks.

  6. Here i tried this one but still i got error that i listed below.

    I got this error :-
    Runtime error 2147467259(80004005)
    can not open database security requested by the login. the login failed.

    In that i have one setup file received from client and i have no code of it. It is windows application and uses a database sql server 2000.

    At the starting page of software it asks about connection string . And i put in it and connection succed it also shows. After it the login page open and there i enter Id and password which are given by client. But got this upper error.
    I tried almost everything and I also tried upper things that u r suggested but still no problem solved. So pls as soon as possible give me some slution of that.
    I heard lots of about you and i also attained yr seminar located at ahmedabad. so pls give me some help
    Thanks & Regards,
    Ravi.

  7. Hello ,
    I asked you one problem. Is anything finding you? If not then pls try it. And also allow it on your this question blog so others can answer also.

  8. This is actually a very bad practice, since many other processes run as Network service.
    All you have to do to properly take care of this is create a new App Pool (Under IIS mmc console, go under app pools) , and right-click, go to properties, then Identity, set it to Configurable, and set the login which has permissions for the databases you’re getting errors for.
    Don’t forget to go to web site properties and change the app pool to the new one you created.

    TK

    • You are a genius. I have been trying to solve this problem for over a year now on a particular server, had all but given up – there are literally hundreds of different solutions offered on the web but none worked for me until I read your solution. Brilliant, I am very grateful to you!

  9. Hi,

    The NT AUTHORITY/NETWORK SERVICE account is automatically created if the SQL Server service is run by NT AUTHORITY/NETWORK SERVICE account. Verify that your SQL server service account is different than this account.

    Regards,
    Pinal Dave

    • Hi Dave,
      I find the thread in this website very helpful, however I have a question about ‘NT AUTHORITY\NETWORK SERVICE’ account, I am getting error “Cannot open database “MyDB.mdf” requested by the login. The login failed. Login failed for user ‘NT AUTHORITY\NETWORK SERVICE’. I have SQL Express 2008 and when I installed it I did not create that account. When I published my website in IIS I am getting that error. Why does my website use ‘NT AUTHORITY\NETWORK SERVICE’. I used windows authentication to login to my Server. My Website worked in Visual Studio. Hope you can help me with this. Thank you

  10. Hi, thanks for the replay

    Even on my developement computer there is no NT AUTORITY\NETWORK SERVICE;

    MY USERS IS:

    BUITLIN\ADMINISTRATOR
    BUILTIN\Users
    leo
    Leonel-PC\SQLServer2005MSSQ
    NT AUTORITY\SYSTEM
    sa

    is there any problem ? cos the System Works well on My computer but on my LAN Server does Not;

    i use windows server 2003 sp2;

    Is there any script to create this user?

    Thanks

  11. Hello.
    And what to do in this case:

    Error of connection with a server -1:4060
    SQLSTATE = 42000
    Microsoft OLE DB Provider for SQL Server
    Cannot open database requested in login ‘MASTER’. Login fails.

    The result is identical on servers: 2000 SP4/2005/2008

    Thanks.

  12. Wow!!!! after 3 days of trying to find why I keep getting this error:

    Cannot open database “” requested by the login. The login failed.

    “Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. ”

    Exception Details: System.Data.OleDb.OleDbException: Cannot open database “FTF” requested by the login. The login failed.

    DID EXACTLY WHAT YOU MENTIONED AND IT WORKED LIKE A CHARM. THANKS YOU SO MUCH !!!

  13. Hi people,

    my english is not good, but i will try to add something.

    my problem was the same, but i couldnt find the NT ACCOUNT,

    So i had to create this account and i had to make method the

    explained to in this spot.

    or try to use this script:

    /****** Object: Login [NT AUTHORITY\SYSTEM] Script Date: 03/20/2010 20:43:01 ******/
    /****** Object: Login [NT AUTHORITY\SYSTEM] Script Date: 03/20/2010 20:43:01 ******/
    CREATE LOGIN [NT AUTHORITY\SYSTEM] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english].

    be cool.

  14. Hi Dave,

    Hope you can help, I been working on connecting to a MSSQL Database for days, and still can’t solve the problem.
    I am developing on Windows 7 64 Notebook.

    I need to access (read) a database which is manage by a Commercial Software (say ‘A’), I am able to connect and work with when the Software A is not running, but when Software A is running my application cannot access the Database and vice versa.

    The database is set to Multiple_User for Restrict Access. The problem is my application must run when the Software A is running.

    I tested it, on its own when in Data Source (ODBC) test or in my application, it works find.

    This is my connection string:
    MSSQL_Con.ConnectionString = “Data Source=.\SQLEXPRESS;Initial Catalog=” & TheDatabase & “;Integrated Security=SSPI;Trusted_Connection=No; Connect Timeout=30;User ID=AMS;Pwd=88888;”

    I had tried Integrated Security – True / False / SSPI
    Trusted Connect – True or False
    User Instance – Tru / False

    it still give me error:
    Cannot open database requested by the login. The login failed. Login failed for user ‘User1′
    User1 is created in Management Studio and tested OK without Software A.

    Please Sir, kindly Help.

    Best Regards

  15. Hi I am getting below error:

    Cannot open database “FTNCorporateAutomation” requested by the login. The login failed.
    Login failed for user ‘NAM\at77221’.

    this is not specific to NT Athority

    Please advise asap.

    Thanks
    Sandeep

  16. Hello Sanddep,

    Please verify login’s access permission in database and Login’s default database. Are you able to connect through other logins or to other datrabases?

    Regards,
    Pinal Dave

  17. Hi guys

    I am getting exactly the same error. This is SQL Server 2000, IIS, ASP web pages, Windows 2000 Server setup. It worked perfectly until we had to restore the whole server due to a virus.

    So reformat, reinstall, etc, etc to a brand new (and virus protected) server.

    I’ve done everything that I did before, got all the correct permissions, etc and I still get this same error. I’ve done what you suggested above and it does not help. We have ODBC connections which work perfectly, we can access the database through a number of query tools.

    What have I missed? I am at my wits end.

    • Could you make a little test and try to connect to master database with your login credentials? For example,write a little ASP.NET WebForm which connects to master db and tries to read something out of it.

  18. Hi Marko

    My problem is that I am not an ASP developer. This program was written a few years ago, and it just chugs along doing it’s thing …. until now. So I have no idea how to do what you are suggesting. I do know that we can connect to the db via ODBC from other pc’s ….

    I kind of think that the setup is wrong somehow but don’t know how or even where to look to correct it.

    • Okay. Then you probably would want to check DB log files. See for entries where Source = Logon. It could be that your web page is not configured properly and it’s trying to connect with wrong credentials.

      Oh, and I just notice that you are talking about ASP pages, not ASP.NET. I know almost nothing about ASP so I’m not be able to help you much. Let’s hope the log reveals something enlightening.

  19. i m trying to install SQL Server 2008 enterprise edition and i m getting error =CLR error 80004005 . dont now what to do. i try to change compatibalty still didnt work. plwase help

  20. Hi,
    I can’t find ” NT AUTHORITY/NETWORK SERVICE ”
    please can you show how can i create this acount
    thanks a lot

  21. Hi Pinal Dave,

    Thank so much for this wonderful solution. it has really solved my problem. More blessing and knowledge to u.

    Sale A. A.

  22. i want to make a data base for school’s result and i want that ,the data base would be seen by the parents but parents can’t change or edit the database ,how can i make my sql data base secure.

    Thanks

  23. hi
    LOONG WITH THIS helopful aarticle USe one addition thing

    use Integrated Security as “Integrated Security=SSPI” your problem will solved you will not get the same error again ..

    regards

  24. I am trying to connect to a database from VS 2008 but am getting the following error:

    Cannot open database “AdventureWorks3″ requested by the login. The login failed.
    Login failed for user ‘HpUser_CPU\Hp User’.
    This website application is stored under:
    c:\Users\Hp User\Desktop\app2\App_Data\AdventureWorks3.mdf

    And when I open SSMS I do not see this database listed; just the System databases. But when I try to open this AdventureWorks3 database and navigate to this folder, I do not see this MDF listed. And I have made Administrator, ASP.NET, and Hp User db_owners on the System databases. What else do I need to do to enable this database for VS 2008?

  25. Now I am trying to add the NETWORK SERVICE login cause I still can’t connect to the AdventureWorks3 database. But I want to add this NETWORK SERVICE login via SQL Server Authentication and not Windows. When I select Windows authentication, it lets me create this login. But when I select SQL Server Auth, it gives me the following error:
    Create failed for Login ‘NT AUTHORITY\NETWORK SERVICE’…’NT AUTHORITY\NETWORK SERVICE’ is not a valid name because it contains invalid characters. (MS SQL Server, Error: 15006)

  26. Mr. Dave,
    I just want to thank you for this posting this article as well as others. This is the second time in as many days that you have helped me out. You are truly the “SQL Authority”!
    Bruce

  27. in SQL server 2000>> Security >> Logins …ooops ..there is not such a thing as “NT AUTHORITY\NETWORK SERVICE”,

    also, my application in debug mode works well, when run it in production, this problem appears, I do not why…

    any suggestions? thanx in advance..

  28. Cannot open database “dating” requested by the login. The login failed.
    Login failed for user ‘sa’.

    now i have read everything you have said up here ..And it is all great and dandy for those who know exactly what they are doing on the pc . I am pretty handy on the pc but there are something I just dont touch . So commands etc are not my thing.. Step by step how to get where and what to click.. yes for us little people out there .. I type the error in to google and get something for everything else.. I am just trying to find out if this is something with my system or what as I just replaced the harddrive and formatted the whole thing.. very frustrating when i start getting errors like this .. if you can help me now that would be great.

  29. When i am trying to install SQL server 2008 enterprise edition i got the following error.

    CLR error: 80004005
    This program will now terminate

    I am using .NET framework 4.0 on windows 7 64bit. I am in a grate trouble and my machine not allowed me to install any version of SQL server. It would be grate if any one would help me.

  30. Dear Dave,

    I need you help regarding my sharepoint problem.
    I have read some of your articles and it was really awesome you have solved most of the problems. That’s why i have decided to ask for your assistance.

    First. problem
    Cannot connect to the configuration database.

    I followed one of your comment regarding the security stuff and mappings , unforunately the Config Database of my sharepoint is not listed on the database of my SQL Instance.

    I try to attach the Configuration database so i can assign the priveleges and this is the error i got.

    TITLE: Microsoft SQL Server Management Studio
    ——————————

    Attach database failed for Server ‘thesqlsps’. (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

    ——————————
    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ——————————

    SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0xb5f67b48; actual: 0xb5f67b58). It occurred during a read of page (1:8670) in database ID 10 at offset 0x000000043bc000 in file ‘C:\Program Files\Microsoft Office Servers\14.0\Data\MSSQL10.SHAREPOINT\MSSQL\DATA\SharePoint_Config_fb7bd063-aee7-46ee-880d-e061c3279fb9.mdf’. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
    Could not open new database ‘SharePoint_Config_fb7bd063-aee7-46ee-880d-e061c3279fb9′. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 824)

    ———

    I tried also using the powershell to run cmdlet commands but still nothing.

    The services of my sharepoint is still running.
    The MDF and LDF files are all intact.
    IIS dont have a problem( I guess)

    Any idea what i’m missing ?
    Thanks in advance.

  31. Hi again,

    I Tried also the Sharepoint 2010 Products Configuration wizard and this is part of the long list of the log file error.

    —–
    Login failed for user ‘ITLAB\Administrator’.
    04/18/2011 04:18:12 8 INF debugMessage for task initialize is An exception of type System.Data.SqlClient.SqlException was thrown. Additional exception information: Cannot open database “SharePoint_Config_fb7bd063-aee7-46ee-880d-e061c3279fb9″ requested by the login. The login failed.
    Login failed for user ‘ITLAB\Administrator’.
    System.Data.SqlClient.SqlException: Cannot open database “SharePoint_Config_fb7bd063-aee7-46ee-880d-e061c3279fb9″ requested by the login. The login failed.
    Login failed for user ‘ITLAB\Administrator’.
    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.SqlClient.SqlConnection.Open()
    at Microsoft.SharePoint.Utilities.SqlSession.OpenConnection()
    at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)
    at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, Boolean retryForDeadLock)
    at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command)
    at Microsoft.SharePoint.Administration.SPLock.ReleaseStaleLock(SqlSession sqlsession, Int32 timeoutInSeconds)
    at Microsoft.SharePoint.Administration.SPLock.CleanupStaleSession()
    at Microsoft.SharePoint.Upgrade.SPManager.AcquireFarmUpgradeLock(Boolean bForce, Boolean singleClickInstall)
    at Microsoft.SharePoint.PostSetupConfiguration.InitializeTask.Run()
    at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()

    ——
    Thanks again in advance

  32. System.Data.SqlClient.SqlException: Cannot open database “Sports” requested by the login. The login failed.
    Login failed for user ‘TUSHAR\DP’.

    i will doing all changes u declard above but this error will occurd. plz tell me the solution.
    thank u.

    i wiil post my codng line below:
    {
    SqlConnection conn = new SqlConnection(“Data Source=Tushar\\SQLEXPRESS;Initial Catalog=Sports;Integrated Security=True;uid=tusharsim;Password=tusharsim”);
    }

    web.config code is:

    plz help me

  33. im geeting the following error
    Cannot open database “userdatabase” requested by the login. The login failed.
    Login failed for user ‘DOTNET1\ASPNET’.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Cannot open database “userdatabase” requested by the login. The login failed.
    Login failed for user ‘DOTNET1\ASPNET’.

    i tried the above but it did’nt help ,the problem is im able to run on my local machine but not on shared network
    my connection string in web .config is above:-

    please help me out .

  34. May tell me about this messages :

    – SHUTDOWN is in progress. Login failed for user ‘xxx’. Only
    administrators may connect at this time.

    – Cannot open database “SignOnDB” requested by the login. The
    login failed. Login failed for user ‘xxx’.

  35. I’m using sqlserver 2005 in that i don’t have option like NTAuthority/network service what shall i do I’m getting this error

    Server Error in ‘/sam’ Application.
    ——————————————————————————–

    Cannot open database “karthik” requested by the login. The login failed.
    Login failed for user ‘HOME-91ECE83970\ASPNET’.

  36. HI,

    Can you help me, i installed primavera in my pc but i cannot open any files on it, it happens only after i imported another file, previously it was okay until i did the last importing. Is there any connection with the sql server regarding this problem. I checked the database it says that database pmdb$primavera is not accessible ( microsoft.SQL server. Express. Object explorer) . Please help. Thank you

  37. Hello Dave, I get this error message in my log when attempting to run the config wizard in sharepoint 2010:
    Failed to connect to the database, and this is in the log.

    A System.Data.SqlClient.SqlException was thrown on server sqlxxx, database master

  38. SQL Server will NOT LET ME create a login for IIS APPPOOL\ASP.NET v4.0!!! Please help. I try and try but keep getting this error: “Windows NT user or group IIS APPPOOL\ASP.NET v4.0 not found. aaarrgghhh!!!

  39. Hello All of u,
    My problem is “Microsoft OLE DB Provider for SQL Server error ‘80040e4d’

    Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’ “i had tried first example of pinal to resolve it,then also,i am on same problem.
    Please help me out,
    Thanks in advance
    Jayanti

  40. Thank you so much! I google for problem solution often and have ended up in your site and found the right solution quite a few times. Kudo to you!

  41. Hi pinal,

    This is Rashmi.I am getting following error some times and not regularly.

    Cannot open database “xyz” requested by the login. The login failed.
    Login failed for user ‘xyz ‘.

    Please Help me…

  42. Hi, Mr. Pinal

    This is Rahul. And my problem is that

    A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 – An established connection was aborted by the software in your host machine.) (Microsoft SQL Server, Error: 10053)

    This problem is occured when i connect to SQLEXPRESS.
    Please help me out.

    Regards
    Rahul Singh

  43. your initial solution resolved my issue I was having after I restored my database from SQL 2000 to SQL 2005 server. Thank you.

    I stumbled upon this while doing many searches. What is the main link to this blog?

  44. Hey., i have trouble in logging to Primavera the error is “Bad public user name or password. Database Server Error: Encryption not supported on the client”.
    Kindly help

  45. I got same Message when I try schedule job to email report from SQSReporting services. I created a new Subscription –> Notify by E-Mail–>
    Scheduling to run once. After I can see that Job created but Failed with error:
    ‘Execute as login’ failed for the requested login ‘NT AUTHORITY\NETWORK SERVICE’. SQL message id = 15406. I follow your instruction and mapped as you provided but still same problem. Do I need restart DB?

  46. microsoft .net application security warning

    I am getting the above error while installing sql server 2008 and i continued installation. After complete installation i am tryed to attach a database . I am getting the errors ……….

  47. Hello Pinal dave
    you are GOD of sql server
    i should have refer your blog four months back itself…
    thank you very much

  48. hi,
    when i try to open server from network computer,error message seen:cannot open database requested in login,login failed for user.

    how can i resolved this problem ?

  49. hi, I used SQLExpress, and in the mapping tab that you said, There is not my database that mentioned to this error; Please help me You can

  50. I don’t think this solution can possibly work for me. First off, NT AUTHORITY\NETWORK SERVICE is not in my Security Login folder. But even if it were, the Database that I am timing out on no longer exists on the either the server on which I am creating the backup nor the server on which I am doing the restore. (I can see the database name out in an error log message on the server where the logon is timing out). The database which I am trying to restore is on both servers, is the database from which the backup ws created and is not the one being requested by the logon.

    So to sumarize MY problem, I am trying to restore a database from one server to another, but when I try put the backup file name in the Specify Backup dialogue box, I get a timeout on the server to which I am trying to apply the restore because the the Logon has requested a database that doesn’t exist anywhere. It did exist a long time ago but it did not exist yesterday when the backup was created.

    Apparently the database name is lingering somewhere but I haven’t been able to find it. Might you have any insight as to why the name of this non-existent database plays a roll in the backup/restore and how I can get rid of it?

    Thanks,
    Alex Scianna
    Monteat College

  51. PS:

    I realized when I got the confirmation to my post that NT AUTHORITY\NETWORK SERVICE is just a user name, and I should substitute the login name that is failing. The point I failed to make is that the database name that the logon is requesting no longer exists and does not appear in the list of databases under the User Mapping tab for any user name.

    Thanks,
    Alex Scianna

  52. Thanks , For this wonderful post. It really solved my problem. You have solved many of my queries earlier also.

    Best Regards

    Sushanth Sreedharan

  53. hello please help me . when i going create new new database on server and after create a login than what i req. for this . coz when i m creating a login than this accessing public (any one can access my database when they are login him userid password )

    so please help me what permission require for for database secure ..

  54. we are having this issue only with sql server 2012, where the login failed user having access if access the database from sql server 2008. Any clue?

  55. Hi All,

    I am trying to mirror a database. Security Configuration was successful. But the following issue occurs when click the ‘Start Mirroring’.

    ***********************************************************************
    TITLE: Database Properties
    ——————————

    An error occurred while starting mirroring.

    ——————————
    ADDITIONAL INFORMATION:

    Alter failed for Database ‘MyDatabase’. (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1540+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Alter+Database&LinkId=20476

    ——————————

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ——————————

    The server network address “TCP://DOMAIN-PC-105:5022″ can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (Microsoft SQL Server, Error: 1418)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=1418&LinkId=20476

    ——————————
    BUTTONS:

    OK
    ——————————

    *****************************************
    DOMAIN-PC-105 is the Principal server here.

    Anyone has any idea on this.

    Thank you,
    Harsha

  56. Hai Sir,I got error like this…i need the solution immediately.i am working in private company i need you help…i got this error “Server was unable to process request.cannot open database”smartclassDB”requested by the login.the login failed.login failed for user ‘Sa’.So what’s solution?give your solution to my mail.

  57. my code is given below

    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = ‘ACCOUNT1_PROFILE’,
    @recipients = ‘xyz@a.com’,
    @subject = ‘TEST’,
    @body = ‘THIS IS A TEST MESSAGE’,
    @execute_query_database = ‘[MHRL Live DB]’,
    @query = ‘”select * from [MAYAR HEALTH RESORTS LTD_$Membership Member Status] where [Member No_]=TGVVHCT00000003″‘

    error msg

    Msg 14661, Level 16, State 1, Procedure sp_send_dbmail, Line 476
    Query execution failed: Msg 4060, Level 11, State 1, Server MEDISPA, Line 1
    Cannot open database “[MHRL Live DB]” requested by the login. The login failed.
    Msg 18456, Level 14, State 1, Server MEDISPA, Line 1
    Login failed for user ‘NT AUTHORITY\SYSTEM’.
    Msg 0, Level 11, State 0, Line 0
    A severe error occurred on the current command. The results, if any, should be discarded.

    pls advice for the same

  58. As many others, I don’t have any user called ‘NT AUTHORITY/NETWORK SERVICE’, and when trying to create it I get the following error message:

    “Windows NT user or group ‘NT AUTHORITY\SYSTEM’ not found. Check the name again.”

    Has anyone solved it?

  59. Hi Dave,

    I have a similar issue here.

    I have 2 instance, A and B. On instance A, in order to let a job access and manipulate data in a database on instance B, a linked server is created. Linked server connection test is successful and from instance A I can even open a new query and retrieve data on instance B. But the job failed with an error: “Login failed for user ‘login_name'”, “Cannot open database “xxx” requested by the login.” The interesting thing here is the ‘login_name’ is not the owner of the job. I set a sysadmin login as the job owner.

    I tried to use your recommendation in this article, but when I open the property of the job owner, I couldn’t find the database on instance B because it is showing only the local databases. Do you think I can do the same configuration under a cross instance environment? I appreciate your time and support. I look forward to your reply. Thanks.

    regards,

    Oliver

    • Sorry, I think I need to correct something I’ve said. In instance B, if we open a login property, we can map the login to a database in instance A. However, even if I make the change, I still get the same error. I’m wondering whether we need to change the job owner on instance A to fix the issue. Thanks

  60. Can I simply just say what a relief to uncover someone
    who genuinely understands what they’re talking about on the internet. You certainly realize how to bring a problem to light and make it important. A lot more people have to read this and understand this side of the story. I can’t believe
    you’re not more popular since you surely possess the gift.

  61. Hi Pinale,

    From my asp.net application , when trying to connect to sql server 2008 i am getting the error “cannot open database “prgndb” requested by the login. The login failed.login failed for the user “prg””. But i am able to connect to database from my sql server. From my asp.net when i am trying to connect to sql server 2008 i got the above error. Please help me……….

  62. Hi Pinale,

    From my asp.net application , when trying to connect to sql server 2008 i am getting the error “cannot open database “prgndb” requested by the login. The login failed.login failed for the user “prg””. But i am able to connect to database from my sql server. From my asp.net when i am trying to connect to sql server 2008 i got the above error. Please help me……….

  63. i just can say thank you so much.your way was successful.i tried many of ways but they didn’t get work.
    thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks

  64. Please help me to correct this error “HRESULT E_FAIL has been returned from a call to a COM component” . It occurs when I brows the cube in visual studio 2008.

  65. hi , i am getting an error when i changed the server, even though my connection string correct. the error is = The supplied connection string is not valid, because it contains insufficient mapping or metadata information.

  66. The supplied connection string is not valid, because it contains insufficient mapping or metadata information. do u know what it means?

  67. Hi Pinal Dave,

    In the Login Properties screen, i can’t locate the database that appear in the error message. So what should i do next?

  68. Pinal, you are the best!!!!!…please provide some performance tuning solution, like…long running query. Also SQL Server Performance Counter guidance.

    Thanks Sumi

  69. Hi..i got the same problem in.. i’m new in asp.net and sql server.. i need to deploy a website in sql server.. how ever, i cannot do insert operation to my website..the error showing is ‘login fair for nt\authority system’..i go through this article and other article.. i still cannot fix my problem..please help me

  70. Hi, i got a similar problem but it involves a different user, i followed the steps but the same error occured. “Cannot open database “HMS_Data” requested by the login. The login failed.
    Login failed for user ‘MIGIDDY-MAC\sharmake’.” is there any other way to solve this error

  71. i tried updating user, and it worked. see below command

    USE ComparisonData// databaseName

    EXEC sp_change_users_login @Action=’update_one’, @UserNamePattern=’ftool’,@LoginName=’ftool';

    just replace user(‘ftool’) accordingly.

    thanks

    shashank

  72. This did not work for me. My account was already set as DBO for my Northwind database. I really don’t know what else to do about this error. Thanks!

  73. Hi, I have an Server connected to Iseries machine via shadow. On Iseries I do not find any error codes. On Server I get the following error:

    Date 9/8/2014 10:36:00 AM
    Log Job History (Read queue SHADOW)

    Step ID 1
    Server SRV001
    Job Name Read queue SHADOW
    Step Name Read queue
    Duration 00:00:09
    Sql Severity 11
    Sql Message ID 50000
    Operator Emailed
    Operator Net sent
    Operator Paged
    Retries Attempted 0

    Message
    Executed as user: NT SERVICE\SQLSERVERAGENT. A .NET Framework error occurred during execution of user-defined routine or aggregate “ReadMessageFromAS400Queue”: System.Runtime.InteropServices.COMException: CWB4016 – cwbCO_Connect returned error code 8411 System.Runtime.InteropServices.COMException: at MidasLib.Queue.ReadMessage() at MidasLib.Messages.spReadMessage(SqlString& sMessage, SqlString AS400, SqlString AS400Library, SqlString AS400Queue, SqlString AS400UserID, SqlString AS400Password) . [SQLSTATE 42000] (Error 50000). The step failed.

  74. i spend my two days on that problem

    Server Error in ‘/Mvc4_demo’ Application.
    Cannot open database “MyDB” requested by the login. The login failed.
    Login failed for user ‘IIS APPPOOL\ASP.NET V4.0 Integrated’

    i was tried number of methods but it’s not solve please give me some guide line.

  75. Hi All I am trying to install SCCM 2012 R2 but got below error I ma not sure what needs to done administrator account having system admin role.

    2014-10-23 10:29:20.45 Logon Login failed for user ‘TEST\Administrator’. Reason: Failed to open the explicitly specified database ‘CM_SCCM’. [CLIENT: 192.168.1.5]

    C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log

    c:\ ConfigMgrSetupWizard
    10/23/2014 10:29:21 AM: ConfigMgrSetupWizard Error: 1 : Exception message: [Cannot open database “CM_SCCM” requested by the login. The login failed.
    Login failed for user ‘TEST\Administrator’.], Exception details: [System.Data.SqlClient.SqlException: Cannot open database “CM_SCCM” requested by the login. The login failed.
    Login failed for user ‘TEST\Administrator’.
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s