| name | sqlserver-schema |
| description | SQL Server DDL patterns — CREATE TABLE with proper data types, ALTER TABLE, idempotent migrations, foreign keys, computed columns, and check constraints. |
SQL Server Schema Management
Use this skill for creating and modifying database schemas, writing migration scripts, and applying DDL best practices.
CREATE TABLE — Data Type Guide
CREATE TABLE dbo.Customers (
CustomerID INT NOT NULL IDENTITY(1,1),
ExternalRef BIGINT NULL,
CompanyName NVARCHAR(200) NOT NULL,
CountryCode CHAR(2) NOT NULL,
Notes NVARCHAR(MAX) NULL,
CreatedAt DATETIME2(7) NOT NULL DEFAULT GETUTCDATE(),
UpdatedAt DATETIME2() ,
BirthDate ,
AppointmentTime () ,
AccountBalance (,) ,
IsActive BIT ,
PublicToken UNIQUEIDENTIFIER NEWSEQUENTIALID(),
PK_Customers CLUSTERED (CustomerID),
UQ_Customers_CompanyName (CompanyName),
CK_Customers_CountryCode (LEN(CountryCode) )
);