sp_AcuInit stored procedure

If the stored procedure sp_AcuInit exists, it is executed when the connection is made to the server. This is a procedure you can set up to do customized initialization. This stored procedure does not take any parameters and does not return any results. This optional stored procedure is executed for all connections by Acu4GL interface to the database, not just for the primary connection.

As an example of customized initialization, you can use this stored procedure to remove stale locks by calling sp_AcuRemoveUnusedLocks_1 (which is installed when all the other stored procedures are installed), or to limit access to the database by certain users during certain hours.

If sp_AcuInit returns an error, the connection is denied and the error is reported to the COBOL program. The method for returning an error is to execute the Transact-SQL statement "raiserror". See your Microsoft SQL Server documentation for information about Transact-SQL and stored procedures.

If the sp_AcuInit procedure exists, it executes whenever Acu4GL makes a new database connection, including FAST_ACCESS connections. Therefore, any customization that you've indicated via sp_AcuInit applies to all connections a transaction makes to the database, not just the primary connection.

Note: The sp_AcuInit procedure executes at connection time. It can exist in any database, but should reside either in the current database or a database in which stored procedures are searched by default (such as master).