SELECT f.name, OBJECT_NAME(f.parent_object_id) TableName, COL_NAME(fc.parent_object_id,fc.parent_column_id) ColName
FROM sys.foreign_keys AS f INNER JOIN sys.foreign_key_columns AS fc
ON f.OBJECT_ID = fc.constraint_object_id INNER JOIN sys.tables t
ON t.OBJECT_ID = fc.referenced_object_id
WHERE OBJECT_NAME (f.referenced_object_id) = '참조테이블명'
'회고록&간단정리' 카테고리의 다른 글
[회고 : 24.02.11] 리액트 props 구조 분해 할당 (0) | 2024.02.11 |
---|---|
HttpServletRequest To MultipartFile (0) | 2024.01.08 |
[회고 : 24.01.08] AS-IS 소스 분석 (0) | 2024.01.08 |
MultipartFile image width와 height 구하기 (0) | 2023.09.25 |
Spring Boot에서 EntityManager 의존성주입 @PersistenceContext과 @Autowired (0) | 2023.09.06 |