SchemaSeed Guides

SQL Server mock INSERT statements

SQL Server uses brackets around identifiers, stores yes/no values as 1 and 0, and expects a national-character prefix when a string should stay Unicode.

INSERT INTO [users] ([id], [full_name], [active])
VALUES (1, N'Ada Lovelace', 1);

Azure SQL uses the same export. Datetimes are written with a space between the date and the time, which SQL Server accepts. Parent inserts still come before child inserts, so a foreign key in the seed file points at a row in an earlier statement.

Generate SQL Server inserts