Give LocalSystem SQL Server Permissions for your SQLEXPRESS database

There are some installations where installing all of SQL Server Management Studio is too cumbersome.

You can use this quick hack if you have sqlcmd installed on your XPressEntry box.

 

Note that this is intended only to be done by someone who understands the ramifications. A better practice is to assign a proper service account to XPressEntryService and proceed that way.

 

First, open a command line. We’re going to be using the sqlcmd utility which comes with SQL Server installations. https://learn.microsoft.com/en-us/sql/tools/sqlcmd-utility

 

sqlcmd -S (local)\SQLEXPRESS

USE XPressEntry

GO

(you’ll see “Changed database context to ‘XPressEntry'”).

CREATE USER [NT AUTHORITY\SYSTEM] FOR LOGIN [NT AUTHORITY\SYSTEM]

GO

EXEC sp_AddRoleMember ‘db_datareader’,’NT AUTHORITY\SYSTEM’

GO

EXEC sp_AddRoleMember ‘db_datawriter’,’NT AUTHORITY\SYSTEM’

GO