SELECT 'Alter Talbe ' + SO.name + ' Drop Constraint '
+ So1.name
FROM dbo.sysobjects SO
INNER JOIN dbo.syscolumns SC
ON SO.id = SC.id
LEFT JOIN dbo.syscomments SM
ON SC.cdefault = SM.id
JOIN sys.objects so1
ON so.id = so1.parent_object_id
AND so1.type_desc = 'DEFAULT_CONSTRAINT'
WHERE SM.text = '(newid())'
ORDER BY SO.[name],
SC.colid
+ So1.name
FROM dbo.sysobjects SO
INNER JOIN dbo.syscolumns SC
ON SO.id = SC.id
LEFT JOIN dbo.syscomments SM
ON SC.cdefault = SM.id
JOIN sys.objects so1
ON so.id = so1.parent_object_id
AND so1.type_desc = 'DEFAULT_CONSTRAINT'
WHERE SM.text = '(newid())'
ORDER BY SO.[name],
SC.colid