Tag Info

Hot answers tagged

1

Let's say the new default you want is 5: DECLARE @sql NVARCHAR(MAX) = N''; SELECT @sql += N'ALTER TABLE ' + t + ' DROP CONSTRAINT ' + c + '; ALTER TABLE ' + t + ' ADD CONSTRAINT ' + c + ' DEFAULT (5) FOR [project_id];' FROM ( SELECT t = QUOTENAME(s.name) + '.' + QUOTENAME(t.name), c = QUOTENAME(d.name) FROM sys.tables AS t INNER JOIN ...



Only top voted, non community-wiki answers of a minimum length are eligible