查看所有表名:
select name from sysobjects where type='U'
查询表的所有字段名:
Select name from syscolumns Where ID=OBJECT_ID('表名')
select * from information_schema.tables
select * from information_schema.views
select * from information_schema.columns
本文介绍了使用SQL查询数据库中所有表名及特定表的所有字段名的方法。通过几个简单的SQL语句,可以轻松获取所需的表结构信息。这些技巧对于数据库管理和开发工作非常实用。
查看所有表名:
select name from sysobjects where type='U'
查询表的所有字段名:
Select name from syscolumns Where ID=OBJECT_ID('表名')
select * from information_schema.tables
select * from information_schema.views
select * from information_schema.columns

被折叠的 条评论
为什么被折叠?