December 22, 2003 at 8:37 pm
Hi there,
Is there an SQL query which retrieves the column names of a table?
Ex: For table Emp, there are cols -- Eno,EName,ESalary.
So, is there a query which I can run on the table Emp so as to retrieve the column names of this table as Eno,EName,ESalary.
Any inputs are welcome. Thanks in advance
December 22, 2003 at 8:55 pm
Example: (change table name from 'Title' to whatever you want)
select sc.name
from sysobjects so
inner join syscolumns sc on sc.id=so.id
where so.type='U' and so.name = 'Title'
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy