空間データ型のテーブルを探す


SELECT
 tab.name AS TNAME,
 sch.name AS SNAME,
 col.name AS CNAME,
 tp.name AS CTYPE
FROM
 sys.tables AS tab
INNER JOIN
 sys.schemas AS sch
ON
 tab.schema_id = sch.schema_id
INNER JOIN
 syscolumns AS col
ON
 tab.object_id = col.id
 INNER JOIN
  sys.types AS tp
ON
 col.xtype = tp.system_type_id AND
 col.xusertype = tp.user_type_id
WHERE
 tab.type_desc = 'USER_TABLE' AND
 (tp.name = 'geometry' OR tp.name = 'geography')
カテゴリー: 運用, 開発 タグ: パーマリンク