Manual creation of the PI AF SQL Server database
- Last UpdatedNov 13, 2025
- 2 minute read
- PI System
- PI Server 2024 R2
- PI Server
In some situations, you may want to create the PI AF SQL Server database manually rather than using the PI Server install kit. Some organizations prefer this approach because they want a database administrator to examine any SQL scripts and run them manually rather than trusting an installation program to create a SQL Server database.
To create the PI AF SQL Server database manually, you must run a batch file called GO.bat, which in turn executes some SQL Server scripts that create the PI AF SQL Server database. To obtain the necessary scripts, you can either:
-
Access the AVEVA Customer Portal Products page.
-
Run the PI Server install kit and select the AF SQL database scripts option but do NOT select the AF SQL script execution. The install kit places GO.bat and the SQL Server scripts in the %PIHOME64%\AF\SQL folder.
Note: To run the necessary scripts from the command line, you must first install the sqlcmd utility. For information about installing sqlcmd, see the Microsoft article sqlcmd Utility.
When you run the GO.bat batch file, it does not create any Windows local groups because those actions may require administrator privileges. Consequently, before you run GO.bat, you must perform a separate procedure to create Windows local groups.
One advantage of creating the PI AF SQL Server database manually by executing the GO.bat batch file is that you can specify the SQL Server instance and port number.
Note: Execution of the PI AF SQL scripts must occur from an account with sysadmin privileges for a new install of a SQL Server instance and db_owner privileges for an upgrade of the SQL Server instance.
After obtaining the PI AF SQL scripts, perform the tasks in this topic to create the PI AF SQL Server database manually.
Microsoft Azure
If you plan to have your PI AF data managed by Azure SQL Database or Azure Managed Instance, you will need to modify the GO.bat file to set the authentication method for Azure SQL. See Set the authentication method in GO.bat for Microsoft Azure.