Login failed for user 'NT AUTHORITY\SYSTEM' in SQL EXPRESS 2005
-
Monday, October 03, 2011 7:30 AMI have developed the windows service & in windows service used the SQL server database .
when i will start the computer my windows service get started but it will not connect to the SQL server .it display the following message
"Cannot open user default database. Login failed.Login failed for user 'NT AUTHORITY\SYSTEM'."
I want to start my service when my computer starting.
how to establish the connection to SQL server database from windows service when starting the computer ?
All Replies
-
Wednesday, October 05, 2011 3:06 AMModerator
Hi vrushali katkade,
According to the error message, you please try to follow the steps below to narrow down this issue:
First, make sure that the login 'NT AUTHORITY\SYSTEM' is existing under Security/Logins Node in the target instance on the management studio. If you cannot find it, please add the login by the following syntax:
sp_grantlogin ' NT AUTHORITY\SYSTEM 'Second, make sure the default database for ' NT AUTHORITY\SYSTEM ' login is available. For more information: Error message when you connect to an instance of SQL Server: "Cannot open user default database".
Third, go to 'Security->Logins' in Management Studio, open the properties window of ' NT AUTHORITY\SYSTEM ' login, at the 'User Mapping' tab, map the appropriate database and select the required database role for each database.If the problem cannot be removed, you may need to check other configurations such as connection string, IIS, etc. Please have a look at the following threads with the similar issue:
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/a31656a9-5715-4910-ad96-fa590344a407http://forums.asp.net/t/1228059.aspx/1
Hope this helps.
Regards,
Stephanie Lv
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Proposed As Answer by Warwick Rudd Wednesday, October 05, 2011 8:12 AM
- Marked As Answer by Stephanie LvModerator Monday, October 10, 2011 1:31 PM

