---
title: "SQL-002: clsAppInfo identity retrieval"
summary: Reads the SQL Server identity value after inserting an application info row.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-24
library: SAIF.Application.LogView
reference_type: package
---

# SQL-002: clsAppInfo identity retrieval

This statement runs immediately after `clsAppInfo` inserts a new `App_Info` row. It reads the current SQL Server session identity so the BOF object can store the generated `AppInfoSeqNum` on the newly saved object.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-002 |
| **Operation type** | Sequence |
| **Execution method** | Inline SQL |
| **Database** | SQL Server |
| **Schema** | N/A |
| **Command type** | Text |
| **Business object** | `clsAppInfo` |
| **Criteria property** | N/A — `DR2.SQLStatement` literal |
| **Lifecycle method** | `BeforeInsert` (`IdentityRetrieve`) |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `None` | N/A | N/A | N/A | No bind variables are present in the SQL text. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| `None` | N/A | No tables are referenced directly; this statement reads the current session identity value after the preceding insert. |

## Sample SQL

```sql
-- Read the current SQL Server identity value for the session
Select @@IDENTITY
```

## Operations and processes
- [Create a new application info log entry from struct](../operations/info-logging.md)
- [Create a new application info log entry from discrete parameters](../operations/info-logging.md)

## Sources
- `Application\SAIF.Application.LogView\clsAppInfo.vb`
