how do i do that??Do you want get column names of a table?
Use system stored procedure sp_help table_name, or use data reader object's member drObj.GetName(I), I is the zero based column ordinal, etc.|||I would like to get the column name of sql DB. I have several tables in DataBase and I would like to do SELECT* to one of the table. Once I did that I want to present the data in a repeater when I am puting in the header of the repeater the name of the columns.|||you need to study Select * From SysColumns|||Dose a SysColumns is a system table?
How can I get the name of a specific columns form syscolumns?|||Hi, wangwei,
Try this in Query Analyzer
select C.name from syscolumns c
join sysObjects O
on C.id = O.id
where O.name = 'Table_name'
and colid = 3
-- here colid is the column Id starting from 1
Hope this helps.|||
dhjiang:
Do you want get column names of a table?Use system stored procedure sp_help table_name, or use data reader object's member drObj.GetName(I), I is the zero based column ordinal, etc.
Thanks this is just what I needed.
No comments:
Post a Comment