Improving Performance - system_counters to SQL Sequences
NextGen Healthcare has updated the counters allocated through the system_counters table. If you have an internal or a third-party application that accesses system_counters through the standard ng_get_system_counter_nbr stored procedure, your application continues to function normally. However, if your application directly accesses the system_counters table, you must update the application to use the ng_get_system_counter_nbr stored procedure.
The following is an example of how to call ng_get_system_counter_nb:
*************************************************************************/
DECLARE @pi_po_result_code INT ,@pi_po_result_message VARCHAR(255) ,@pi_pi_counter_type VARCHAR(40),@pi_po_counter_nbr BIGINT
SET @pi_pi_counter_type = 'appt_nbr'
EXEC [ng_get_system_counter_nbr] @pi_po_result_code OUTPUT,@pi_po_result_message OUTPUT,@pi_pi_counter_type, @pi_po_counter_nbr OUTPUT
select @pi_po_counter_nbr
-- This would return the next appt_nbr and update the system_counters table