You've already forked ssms-addin
mirror of
https://github.com/alex-bochkov/ssms-addin.git
synced 2026-06-15 16:57:06 +02:00
Create untrusted-constraints.sql
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
SELECT '[' + s.name + '].[' + o.name + '].[' + i.name + ']' AS keyname
|
||||
from sys.foreign_keys i
|
||||
INNER JOIN sys.objects o ON i.parent_object_id = o.object_id
|
||||
INNER JOIN sys.schemas s ON o.schema_id = s.schema_id
|
||||
WHERE i.is_not_trusted = 1 AND i.is_not_for_replication = 0;
|
||||
GO
|
||||
SELECT '[' + s.name + '].[' + o.name + '].[' + i.name + ']' AS keyname
|
||||
from sys.check_constraints i
|
||||
INNER JOIN sys.objects o ON i.parent_object_id = o.object_id
|
||||
INNER JOIN sys.schemas s ON o.schema_id = s.schema_id
|
||||
WHERE i.is_not_trusted = 1 AND i.is_not_for_replication = 0 AND i.is_disabled = 0;
|
||||
GO
|
||||
Reference in New Issue
Block a user