DataBase/SQL Server
Identity 속성을 갖는 테이블/컬럼 찾기
탑~!
2020. 7. 29. 11:08
Identity 속성을 갖는 테이블/컬럼 찾기
----------------------------------------------------------------------------------------------------
SELECT
B.name AS [Table]
,A.name AS [Colum]
FROM syscolumns A
JOIN sysobjects B ON B.id = A.id
WHERE A.status = 128 -- Identity 컬럼은 0x80 값을 갖는다.
AND B.name NOT LIKE 'queue_messages_%'
ORDER BY
B.name ASC
,A.name ASC;
----------------------------------------------------------------------------------------------------
출처: https://icodebroker.tistory.com/1719 [ICODEBROKER]