상세 컨텐츠

본문 제목

Identity 속성을 갖는 테이블/컬럼 찾기

DataBase/SQL Server

by 탑~! 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]

관련글 더보기