dotnet-sqlserver-best-practices
Installation
SKILL.md
SQL Server Best Practices for .NET
Overview
Best practices for SQL Server database design, naming conventions, indexing, and performance optimization when using with .NET and Entity Framework Core.
Quick Reference
| Category | Best Practice |
|---|---|
| Naming | PascalCase for tables/columns |
| Primary Keys | Use uniqueidentifier (Guid) with NEWSEQUENTIALID() or int/bigint IDENTITY |
| Timestamps | Use datetimeoffset with UTC |
| Indexes | Index foreign keys, unique constraints |
| Strings | Use nvarchar(n) with explicit lengths |
| JSON | Use nvarchar(max) with JSON functions (SQL Server 2016+) |