1
The Network Service account is a built-in account that has more access to resources and objects than members of the Users group. A service running as the Network Service account accesses network resources using the credentials of the computer account. The actual name of the account is "NT authority\network SERVICE".
How to solve this situation?
Method One (Management Studio User Interface):
Open SQL Server Management Studio, click Security and Logins, right-click NT Authority\Network SERVICE, select Properties. (Add this login if there is no NT Authority\Network SERVICE)
On the Login Properties page that opens, click User Mapping. On the "User Mapping" page, select the database you want to connect to, at the bottom of this page, select db_owner role and click OK.
Method Two (T-SQL):
1. Add the user NT Authority\Network Service to SQL Login. (So the user is already in SQL login, omit this step)
EXEC sp_grantlogin N ' NT authority\network SERVICE '
GO
2. Assign the permissions of db_owner to NT Authority\Network SERVICE.
Use Your_db_name
GO
EXEC sp_addrolemember ' db_owner ', N ' NT authority\network SERVICE '
GO
How to resolve the "Cannot open database, user NT Authority\Network SERVICE login failed" error?