在一本书上看到的查询一个表的所有列名的语句,试了一下确实可以(在SQL Server 2005上): select name from syscolumns where id=object_id('表名');