Identifying Records by TS_ID and Table ID

The most efficient way to identify an SBM record is by its TS_ID and table ID. Every table in the SBM database contains an integer column named TS_ID. All TS_ID values are unique within their table. In turn, each table is assigned a unique numeric ID, stored in the TS_ID column of the TS_TABLES table. Any row in the SBM database can be uniquely identified by its table ID and its TS_ID.

For example, to identify the project record for an SBM Project named "My Project," you can supply the table ID for the Projects table and the TS_ID of the row containing "My Project." The TS_TABLES table contains a row with "Projects" as the TS_NAME value. That row describes the Projects table; it has a TS_DBNAME of "TS_PROJECTS" and a TS_ID of 8. In the TS_PROJECTS table, the row with a TS_NAME of "My Project" may have a TS_ID of 47. In that case, the "My Project" project is uniquely identified by a table ID of 8 and a TS_ID of 47. SQL statements attempting to query the Projects table should use the database name "TS_PROJECTS" given in the TS_DBNAME column of TS_TABLES.

Since there are typically multiple Primary and Auxiliary tables, primary and auxiliary items must be identified by both their table ID and TS_ID. The table ID is often thought of as the item type. For example, an issue would reside in the Issues table, being a different type of primary item than an incident which resides in the Incidents table.

Shell Properties contains a detailed listing of all table IDs and TS_IDs that are passed to a script at runtime. Application Objects lists many object methods that use table IDs and/or TS_IDs as parameters or return values.
Note: Valid TS_ID and table ID values are positive numbers. Other values typically indicate an error or a result of "none."

Related Topics

Identifying Records by Item Name

Working with SBM Database Records