First, it is not wise to only have a subject, as your question can get cut
off and, therefore, never answered. Best to put the question in the body,
even if it is a repeat.
To find columns, you use the system tables (or Sys views: SQL Server 2005).
I do not have a query for this, however. The SQL Server Programming group is
the best shot for this; Aaron Bertrand's ASPFAQ.com site may have an answer,
as well (Aaron is a SQL Server MVP).
In a more generic way, you can use SQL-DMO, but this involves interop with
..NET. There is also an ADO library (ADOX, I believe) that will work against
multiple types of databases; it is also Interop.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
***************************
Think Outside the Box!
***************************