数据库SQL2000中如何只查表中的列名

来源:百度知道 编辑:UC知道 时间:2024/05/14 14:26:40
如何用语句在SQL2000中查询表中的列名,只要列名,其它的参数不要显示
希望大家不要通过复制来回答
这条语句
exec sp_help 此处放要查询的表名
这条语句查出来的东西太杂,我只要查出有哪些列名就可以了,
希望知道的朋友回答一下,
我不管是什么方法,我只是要查询表里边显示我原来不知道的列名
比如:pubs数据库中的内容

select name
from syscolumns
where id=object_id('表名')
order by colorder

select * from syscolumns where id =(
select id from sysobjects where name='tablename')

exec sp_help
你这个像是执行的存储过程
把sp_help的内容贴出来看看
select 列名,列名,列名... from 表名
就行

select name from myform where id<>0

select (列名) from (表)