user1107108
user1107108

Reputation: 65

How to see Table columns in sorted order in Sybase

sp_help lists the table columns but they are not sorted as per their names (perhaps as per the actual order in which they are present in table i guess). For many columns in a table it gets difficult to find a column name , so is there any way i can see column names sorted by their names.

Upvotes: 0

Views: 2172

Answers (1)

Sachu
Sachu

Reputation: 7766

select col.name from 
sysobjects tab 
inner join 
syscolumns col 
on tab.id = col.id 
where tab.type = 'U' 
and tab.name = 'TABLE_NAME' 
order by col.name

Upvotes: 1

Related Questions