@dhma.chDaniel Hutmacher @dhma.ch
2026-11-08 18:29 UTC
Name your #sqlserver default constraints, or there will be trouble. Instead of... ALTER TABLE dbo.table ADD col int NOT NULL DEFAULT (0) ... use... ALTER TABLE dbo.table ADD col int NOT NULL CONSTRAINT DF_table_col DEFAULT (0) And if you forgot, here's a script for you to help fix the database.
Link: Add name to system-named default constraints (gist.github.com/dhmacher/12e8820d318c4d44c2039b39e6101839)
10 likes, 0 reposts, 1 replies
3 Next post4 More from @dhma.chBackBluesky home