取得表名以h_开头的表:
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' and LEFT(TABLE_NAME,2)='h_'and TABLE_SCHEMA='p'
特别注意:
不能使用TABLE_NAME like 'h_%'
因为sql2008会得到hh_开头的表。要注意!
取得表名以h_开头的表:
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' and LEFT(TABLE_NAME,2)='h_'and TABLE_SCHEMA='p'
特别注意:
不能使用TABLE_NAME like 'h_%'
因为sql2008会得到hh_开头的表。要注意!