SqlServer查询所有表名 查询表的所有列名

说明:列出数据库里所有的表名 
select name from sysobjects where type='U' 
 
说明:列出表里的所有的列 
select name from syscolumns where id=object_id('TableName') 

原文地址:https://www.cnblogs.com/barrysgy/p/2821436.html