Technical FAQs

Ask a Question

Side by side IONE 6.0.1 to PME 8.0 upgrade - 'FIX_IONMaintenance_Users.sql' query fails

During the side by side IONE 6.0.1 to PME 8.0 Upgrade, the 'Re-sync the database users with the SQL server logins' step requires that the 'FIX_IONMaintenance_Users.sql' query needs to be executed in order to update the IONMaintenance user. This script deletes the IONMaintenance user in all four Power Monitoring Expert databases and the IONMaintenance user from Security > Users. The script then recreates the IONMaintenance user and associates it with the new server name, computer, and login. The new user is set with the correct memberships (db_ddladmin, db_backupoperater, and Maintenance). 

When attempting to execute the query within SQL Server 2008 R2, SQL server management studio will return:

Incorrect syntax near 'ADD'.  Expecting WITH

Product Line
StruxureWare Power Monitoring Expert Base, Data Center Edition

Power Monitoring Expert 8.x, SQL Server 2008 R2 Standard/Express

The FIX_IONMaintenance_Users.sql script was developed for SQL Server 2012 or later.

**Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.

The 'ALTER ROLE' function in the 'FIX_IONMaintenance_Users.sql' script is required to be to modified to reflect the syntax below:

sp_addrolemember [ @rolename = ] 'role', [ @membername = ] 'security_account'

** The 'sp_addrolemember' function was removed from subsequent versions of SQL Server. Only use this SQL transaction in SQL Server 2008 R2.


ALTER ROLE [db_backupoperator] ADD MEMBER [IONMaintenance]

Do the following:

exec sp_addrolemember @rolename = 'db_backupoperator', @membername = 'IONMaintenance'

Was this helpful?
What can we do to improve the information ?