Can anybody tell me how to get the datatype and size of a field in a table using SQL or in VB
Thanks in advance
Venky
Printable View
Can anybody tell me how to get the datatype and size of a field in a table using SQL or in VB
Thanks in advance
Venky
I Don't know which database you're using but in SQL_SERVER 6.5 if you use the system stored procedure sp_columns and pass it a table name as a string then it will return you the information that you want in
TABLE_NAME,COLUMN_NAME,TYPE_NAME and LENGTH.
ie sp_columns 'table1' will return all the columns in table1 along with their data types and lengths of those datatypes
Hope this helps.