Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Columns types by SQL query ? 1

Status
Not open for further replies.

fb3034

IS-IT--Management
Aug 12, 2006
1
FR
Hello everybody,

Is there a way to get all the column types of a DB Table (varchar(x), tinyint, date, ...) with an sql query (select or whatever) ?
Thanks for any input !

-- Fab
 
depends on the database system

the ANSI SQL way is to query the INFORMATION_SCHEMA.COLUMNS view

select column_name
, data_type
from information_schema.columns
where table_name = 'mytable'
order
by ordinal_position

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top