Home All Groups Group Topic Archive Search About

How can I print column name only from table?

Author
3 May 2006 5:55 PM
coke
Is there some Sp out there?

Author
3 May 2006 6:01 PM
Omnibuzz
select column_name
from information_schema.columns where
table_name = 'tbl1'

tbl1 is the table for which you want to find the list of columns.
Hope this is what you want.
--




Show quote
"coke" wrote:

> Is there some Sp out there?
Author
3 May 2006 6:03 PM
Alejandro Mesa
coke,

Check the view INFORMATION_SCHEMA.COLUMNS.

Example:

use northwind
go

select TABLE_NAME, COLUMN_NAME
from INFORMATION_SCHEMA.COLUMNS
where TABLE_SCHEMA = 'dbo' and TABLE_NAME = 'Orders'
order by ordinal_position
go


AMB

Show quote
"coke" wrote:

> Is there some Sp out there?

AddThis Social Bookmark Button