Create SQL logins
- Last UpdatedOct 29, 2025
- 1 minute read
If the database is on the same server as IIS server, then use the IIS Apppool\APAWebApi identity. If the database is on a different server, then use the <domain>\<servername>$ identity.
Grant database access to the remote server where the IIS is set up and create a SQL user.
Grant database access to the remote server
-
Run the following script:
USE [master]
GO
CREATE LOGIN [<domain>\<hostname>$] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
USE [<Your APA Database>]
GO
CREATE USER [<domain>\<hostname>$] FOR LOGIN [<domain>\<hostname>$]
GO
USE [[<Your APA Database>]
GO
ALTER ROLE [db_owner] ADD MEMBER [<domain>\<hostname>$]
Note: Run the first and second SQL command only once.
Create a specific SQL user for the AVEVA Production Accounting – Web application
-
From the SQL Server Management Studio, run the following script:
USE MASTER
GO
CREATE LOGIN <Login User Name> WITH PASSWORD = '<Login Password>'
GO
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'<Login User Name>')
BEGIN
CREATE USER [<Login User Name>] FOR LOGIN [<Login User Name>]
END;
GO
EXEC sp_addsrvrolemember N'<Login User Name>', N'sysadmin'
GO
-
Check that the DB user created above is able to log into the SQL server and that you have appropriate permissions to modify the database.