ResponseSerial table
The ResponseSerial table stores the maximum serial number in use for each project in the database. The Variables table is used in both the RDB DSC 2 and RDB DSC schemas.
Columns
VariableID
Key: Yes
Column type: Integer
Holds the VariableID of the Respondent.Serial variable for the project.
MaxSerialID
Key: No
Column type: Integer
Holds the current maximum serial number in use.
Notes
UNICOM Intelligence Data Model 2.3 uses the RESERVE_SERIAL_EX
Stored procedures to retrieve the next serial number for the project. RESERVE_SERIAL_EX locks the entire Responses table to find the maximum value of the serial number, increments it, inserts the new serial number into the Responses table, and returns the number to the client.
UNICOM Intelligence Data Model 2.4 and later uses the more efficient sp_ReserveSerial stored procedure to retrieve the next serial number for the project from the ResponseSerial table. However, if sp_Reserve_Serial fails to insert the new number into the Responses table, it executes the RESERVE_SERIAL_EX stored procedure. This handles situations where nonconsecutive serial numbers have been used and where an earlier version of the Relational MR Database CDSC has connected and incremented the serial number using RESERVE_SERIAL_EX.
For example, suppose MaxSerialID is 256 in the ResponseSerial table and that a Sample Management script has specified a serial number of 512 and this has been inserted into the Responses table. sp_ReserveSerial uses 257 as the next serial number and writes it to MaxSerialID and inserts it into the Responses table. sp_ReserveSerial continues like this until it tries to insert 512 into the Response table and fails. It will then execute RESERVE_SERIAL_EX, which will retrieve the next serial number of 513, and sp_ReserverSerial will write this to MaxSerialID.
In databases that use the RDB DSC 2 schema, the sp_ReserveResponseSerial and sp_ReserveResponseSerialEx stored procedures are used in a similar way to HOW sp_ReserveSerial and RESERVE_SERIAL_EX are used in Data Model 2.4 and later.
See also