| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
How to know column typeHi all:
I want to know if there is a SQL statement that allows me to know the type of each column (string, integer, boolean, float, date,etc.) in a table. I'm using ODBC for a MSAccess database. Thanks |
|
|||
|
Quote:
Code:
sp_columns 'tableNamehere' Just use the tableName. |
|
|||
|
Hi:
Thanks for your answer. Unfortunatelly when I tried to do it, there was an error message saying: SQL instruction non valid. The system expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'. I',m using the Microsoft Access Driver vs 4.0. BTW: in my application we are not using any other server than the ODBC administrator that WinXP has. Is there another option to get this info using the basic SQL commands (independent of any db engines)? Thanks for your help and best regards |
|
|||
|
This information is stored in the so called 'Information Schema', in engines who support it. Information schema is part of the ANSI SQL specification, but generally speaking not a mandatory one.
|