怎样用SQL查询一个表的所有字段
可以用一句sql语句查询解决,如要查test表中的所有字段及类型
Select b.name as TableName,C.name AS TYPE from syscolumns a,sysobjects b,systypes c where a.id = b.idand b.type = 'U' and a.xtype=c.xtypeand b.name='TEST';结果截图:
sql如何查某个表某个字段的数据类型?
select column_name,data_type from information_schema.columns where table_name = 'table_1' and column_name='A'如果把 and column_name='A' 去掉,则会显示表的所有字段的数据类型