テーブル名からカラム名と型を得る
select columns.name, types.name from sys.columns join sys.types on ( columns.system_type_id = types.system_type_id and types.user_type_id <> 256 ) where object_id = object_id('Employees') order by column_id
出力例
columnName | typeName |
---|---|
name | name |
EmployeeID | int |
LastName | nvarchar |
FirstName | nvarchar |
Title | nvarchar |
TitleOfCourtesy | nvarchar |