Database/SQL Server
SQL Server - 모든 테이블의 리스트 T-SQL query
청렴결백한 만능 재주꾼
2020. 12. 10. 01:49
반응형
SQL sever management studio 에서 특정 데이트베이스의 테이블 리스트를 불러오기 위해 쓸 수 있는 3가지의 쿼리가 있음.
-- Gets the list of tables only
Select * from SYSOBJECTS where XTYPE = 'U'
-- Gets the list of tavbles only
Select * from SYS.TABLES
-- Gets the list of tables and views
Select * from INFORMATION_SCHEMA.TABLES
-- Gets the list of different object types(XTYPE) in da database
Select Distinct XTYPE from SYSOBJECTS
-- Gets the list of views
Select * from SYS.VIEWS
-- Gets the list of Procedures
Select * from SYS.PROCEDURES
반응형