Friday, July 18, 2008

Selecting the column names of a sql table

Order defaults to alpha..


SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name= 'MyTable')

Order set to column order..


SELECT name FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name= 'MyTable')ORDER by colorder

No comments: