# Typeorm Mssql

> MSSQL-specific TypeORM conventions - camelCase identifiers, int identity primary keys, getutcdate timestamps, bit soft delete, and filtered unique indexes. Load alongside typeorm for SQL Server projects.

- Skill: `carlosferorduna/typeorm-mssql` (Agent Skill)
- Install (CLI): `npx skillmds@latest add carlosferorduna/typeorm-mssql`
- Raw SKILL.md: https://api.skillmd.com/api/skills/carlosferorduna/typeorm-mssql/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: CarlosFerOrduna (https://skillmd.com/u/carlosferorduna)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/carlosferorduna/typeorm-mssql

---


# TypeORM (MSSQL)

Load alongside `typeorm`. Covers SQL Server decisions only; the portable rules
live in the `typeorm` skill.

## Identifiers

- Tables and columns are singular camelCase: `@Entity('userProfile', { schema: 'dbo' })`, `@Column('varchar', { name: 'email', length: 50 })`. SQL Server is case-insensitive, so camelCase never forces quoting.
- FK columns are named `<entity>Id` (e.g. `createdByUserId`).

## Primary keys

- `int` identity: `@PrimaryGeneratedColumn({ type: 'int', name: 'id' })`.

## Logical columns

- Timestamps: `@Column('datetime', { name: 'createdAt', default: () => 'getutcdate()' })` (also `updatedAt`).
- Soft delete: `@Column('bit', { name: 'deleted', default: 0 })` plus `deletedAt` and optional `deletedBy`.

## Indexes

- Filtered unique indexes match the SQL exactly: `@Index('UQ_player_email', ['email'], { unique: true, where: 'email IS NOT NULL AND hasVerifiedEmail = 1 AND deleted = 0' })`.

