alex_lo

导航

SQL Server schema 用法

查看所有表名:
select    name    from    sysobjects    where    type='U'

查询表的所有字段名:
Select name from syscolumns Where ID=OBJECT_ID('表名')

根据字段,查字段所在的表,注意要大写

select * from INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME = 'smpl_id'

select * from INFORMATION_SCHEMA.TABLES
select * from INFORMATION_SCHEMA.VIEWS
select * from INFORMATION_SCHEMA.COLUMNS

posted on 2013-01-24 17:08  alex_lo  阅读(752)  评论(0编辑  收藏  举报