---
title: "SQL-004: clsAppInfo.InsertSQL"
summary: Inserts a new application info or audit row into App_Info.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-24
library: SAIF.Application.LogView
reference_type: package
---

# SQL-004: clsAppInfo.InsertSQL

This insert statement writes one application info or audit row to `NetFramework.dbo.App_Info`. It stores application and page context, machine and environment, user name, message text, data text, create date, and the 30-day purge date applied by the insert lifecycle.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-004 |
| **Operation type** | Create |
| **Execution method** | Inline |
| **Database** | SQL Server |
| **Schema** | `NetFramework.dbo` |
| **Command type** | Text |
| **Business object** | `clsAppInfo` |
| **Criteria property** | `InsertSQL` |
| **Lifecycle method** | `BeforeInsert` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `@App_Name` | Input | `String` | 50 | Application name from the audit payload or explicit overload argument. |
| `@Create_Date` | Input | `DateTime` | N/A | Audit timestamp. |
| `@Environment` | Input | `String` | 50 | Runtime environment name. |
| `@Machine_Name` | Input | `String` | 50 | Machine or host name that logged the audit message. |
| `@Page_Name` | Input | `String` | 50 | Page or request context name. |
| `@Data_Text` | Input | `String` | `DataText.Length` | Audit payload or detail text. |
| `@Purge_Date` | Input | `DateTime` | N/A | Retention cutoff set to 30 days after creation. |
| `@User_Name` | Input | `String` | 50 | User name associated with the audit event. |
| `@Message_Text` | Input | `String` | 200 | Audit message summary text. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [App_Info](../database-tables.md#app_info) | INSERT | `App_Name`, `Page_Name`, `Machine_Name`, `Environment`, `User_Name`, `Message_Text`, `Data_Text`, `Create_Date`, `Purge_Date` |

## Sample SQL

```sql
INSERT INTO NetFramework.dbo.App_Info
           (App_Name
           ,Page_Name
           ,Machine_Name
           ,Environment
           ,User_Name
           ,Message_Text
           ,Data_Text
           ,Create_Date
           ,Purge_Date)
     VALUES
           (@App_Name
           ,@Page_Name
           ,@Machine_Name
           ,@Environment
           ,@User_Name
           ,@Message_Text
           ,@Data_Text
           ,@Create_Date
           ,@Purge_Date)
```

## 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)

## Business rules
- [BR-006: Inserts must affect exactly one row](../business-rules.md#br-006-inserts-must-affect-exactly-one-row)
- [BR-007: Audit rows receive a 30-day purge date](../business-rules.md#br-007-audit-rows-receive-a-30-day-purge-date)

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

