October 8, 2003 at 7:29 am
How do I run a SQL statement that will give me the fields on the specific table?
thanks in advance
Nelson
October 8, 2003 at 7:44 am
I assume you mean columns 🙂
sp_help 'tablename'
If that is not what you need, please specify
HTH
Ray Higdon MCSE, MCDBA, CCNA
------------
Ray Higdon MCSE, MCDBA, CCNA
October 8, 2003 at 7:57 am
Another way could be
SELECT
*
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME ='mails_header'
Frank
Damm, I should get used to this to promote my site
http://www.insidesql.de/scripts/sqlserverfaq.php?id=19
Edited by - Frank Kalis on 10/08/2003 08:11:37 AM
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
October 8, 2003 at 8:37 am
Thank you !!! works
November 3, 2003 at 2:47 pm
You can run on any database, the where clause is optional.
select o.name as 'Obj Name',
c.name as 'Col Name'
from sysobjects o
join syscolumns c on o.id = c.id
Where o.name like '%objects%'
order by 1,2
Thank you.
Francis S. Mazeika
MS SQL DBA
609-707-5207
francis.mazeika@gmail.com
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply