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 2000 Forums
 Transact-SQL (2000)
 How to get the last column info of the given table

Author  Topic 

jpham
Starting Member

19 Posts

Posted - 2006-10-18 : 17:48:00
Hi All,
I want to get the last column information like :
column name, datatype of the last column in the given
table use SQL statement. Please help.
Thanks,
JP

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-10-18 : 18:03:02
Use the INFORMATION_SCHEMA COLUMNS view like this
select top 1 Column_Name, Data_Type from INFORMATION_SCHEMA.COLUMNS
where Table_Name = 'Orders'
order by Ordinal_Position desc
Go to Top of Page

jpham
Starting Member

19 Posts

Posted - 2006-10-18 : 19:50:57
Thanks! It worked.
JP
Go to Top of Page
   

- Advertisement -