Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 column names

Author  Topic 

magmo
Aged Yak Warrior

558 Posts

Posted - 2008-04-10 : 02:51:57
Hi

When I run this query..

SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='TableTest'

I get all the column names, but the result is not in the same order as when I check the design for the table, why is that?

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2008-04-10 : 03:08:59
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='TableTest'
order by ORDINAL_POSITION


elsasoft.org
Go to Top of Page

magmo
Aged Yak Warrior

558 Posts

Posted - 2008-04-10 : 05:06:25
:-)
Thanks!
Go to Top of Page
   

- Advertisement -