SQLに関するdhpのブックマーク (1)

  • [SQL Server 2005] SQL Serverでテーブル定義取得

    SQL Server 2005で、テーブル定義らしいものを取得するクエリです。 これを使って、テーブル定義書を自動生成させてます。 select Col.name as '名称' ,(Select top 1 name From systypes Where systypes.xtype = Col.xtype) as '型' ,Col.length as '桁数' ,case isnull(Col.scale,0) when 0 then ' ' else cast( Col.scale as char(10) ) end '小数部' ,case Col.isnullable when 0 then '○' else ' ' end 'NN' ,isnull((select case colid when 0 then '' else '○' end from sysindexkeys

    dhp
    dhp 2010/07/04
    テーブルの定義情報(メタデーター)を調べるSQLスクリプト
  • 1