Update mssql.md
This commit is contained in:
parent
06c469fbed
commit
534d6e1d8a
1 changed files with 3 additions and 0 deletions
|
|
@ -1,4 +1,6 @@
|
|||
--- query foreign keys on all tables (local/remote) matching a pattern
|
||||
|
||||
```SQL
|
||||
SELECT
|
||||
OBJECT_NAME(f.parent_object_id) as tablename,
|
||||
OBJECT_NAME(f.referenced_object_id) as remote_tablename
|
||||
|
|
@ -6,3 +8,4 @@ FROM sys.foreign_keys as f
|
|||
WHERE OBJECT_NAME(f.referenced_object_id) not like 'SWE_%'
|
||||
AND OBJECT_NAME(f.parent_object_id) like 'SWE_%'
|
||||
order by tablename;
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue