目次

一覧取得

データベースの一覧

SELECT name, database_id, create_date FROM sys.databases 

テーブルの一覧

#全テーブル取得
select * from sys.objects

#ユーザーテーブル一覧
select * from sys.objects where type = 'U'

#特定(hoge)のスキーマ配下のテーブル一覧
select * from sys.objects where schema_id = schema_id('hoge')