SQL Server Naming Conventions

Naming conventions (also known as identifier naming standards) are essential technical rules for choosing consistent, meaningful names for database objects and fields. They improve readability, reduce errors, and enhance cross-team collaboration.

Object Names (Tables, Views, Stored Procedures, Functions)

  • Use PascalCase (UpperCamelCase) for all database object names.
    • Examples: YellowTripData, GenerateZoneSummary, uspCreateTaxiTables.
  • Avoid underscores in object names—PascalCase is cleaner, easier to type, and aligns with many AppDev frameworks.

Column Names and Parameters

  • Use camelCase for all internal column names, stored procedure parameters, and variables.
    • Examples: pickupDate, zoneId, totalAmount.
  • This follows common practices in application development and APIs, making integration seamless (especially for JSON serialization).

API / JSON Output

  • Return camelCase field names to clients to meet application and API consumer conventions.
SELECT [zoneId] = [PULocationID],
    [tripCount] = COUNT(*)
FROM [dbo].[YellowTripData]
GROUP BY [PULocationID]
FOR JSON PATH, ROOT('zones');

Naming Convention Principles

Naming conventions (also known as identifier naming standards) are essential technical rules for choosing consistent, meaningful names for database objects and fields. They improve readability, reduce errors, and enhance cross-team collaboration :contentReference[oaicite:0]{index=0}.

Object Names (Tables, Views, Stored Procedures, Functions)

  • Use PascalCase (UpperCamelCase) for all database object names.
    • Examples: YellowTripData, GenerateZoneSummary, uspCreateTaxiTables.
  • Avoid underscores in object names—PascalCase is cleaner, easier to type, and aligns with many AppDev frameworks.

Column Names and Parameters

  • Use camelCase for all internal column names, stored procedure parameters, and variables.
    • Examples: pickupDate, zoneId, totalAmount.
  • This follows common practices in application development and APIs, making integration seamless (especially for JSON serialization).

API / JSON Output

  • Return camelCase field names to clients to meet application and API consumer conventions.
    SELECT [zoneId] = [PULocationID],
      [tripCount] = COUNT(*)
    FOR JSON PATH, ROOT('zones');
    

    ⬆ Back to Top

Updated: