Upgrade PI AF SQL Server database via the command line
- Last UpdatedOct 02, 2024
- 1 minute read
- PI System
- PI Server 2018
- PI Server
We recommend upgrading the PI AF SQL Server database by executing the AF SQL scripts using the PI Server install kit. However, you may need to consult with your SQL Administrator first, or may need to upgrade the PI AF SQL Server database at a later time. In this scenario, you may need to execute the AF SQL scripts prior to installing the PI AF Application Service.
You have the ability to manually execute the AF SQL scripts through the command line through the go.bat command. You can specify the SQL Server instance and port number, as follows: SQLServer,Port# or SQLServer\InstanceName,Port#.
-
To run the necessary scripts from the command line, you must first install the ODBC version of the sqlcmd utility. For information about installing the ODBC version, see the Microsoft article sqlcmd Utility.
-
The execution of the AF SQL scripts must occur from an account with db_owner privileges on the SQL Server instance for an upgrade.
To upgrade the PI AF SQL Server database through the command line, as opposed to automatically as part of the setup, disable AF SQL Script Execution during the PI AF Application Service upgrade with the PI Server install kit.
The SQL Server scripts and the GO.bat file are placed in the %PIHOME64%\AF\SQL or %PIHOME%\AF\SQL folder. The GO.bat file contains the commands that execute the deployed SQL Server scripts manually.
Upon execution, the scripts upgrades the PI AF SQL Server database and populate its tables.
Note: The execution of the scripts must occur from an account with db_owner privileges on the SQL Server instance.