After successfully connecting to a Microsoft SQL Server database using SQLCA in PowerBuilder 2022 R2 and the MSOLEDBSQL 19.3.3.0 driver, I am trying to call the sp_addapprole stored procedure using the following code:
string ls_sql
ls_sql = "sp_setapprole @rolename=N'rolename', @password=N'" + "rolepassword" + "'" (rolename and rolepassword have been replaced)
execute immediate :ls_sql;
sqlca.sqlcode is -1
sqlca.sqlerrortext = The procedure 'sys.sp_setapprole' cannot be executed within a transaction.
How can I execute this stored procedure outside a transaction? Everything we are currently doing is within a transaction.