select column_name,data_type from information_schema.columns where table_name = 'table_1' and column_name='A'如果把 and column_name='A' 去掉,则会显示表的所有字段的数据类型
select a.name as [column],b.name as type
from syscolumns a,systypes b
where a.id=object_id('表名') and a.xtype=b.xtype and a.name='列名'
【延展】
SQL是什么意思?
SQL是英文Structured Query Language的缩写,意思为结构化查询语言。SQL语言的主要功能就是同各种数据库建立联系,进行沟通。按照ANSI(美国国家标准协会)的规定,SQL被作为关系型数据库管理系统的标准语言。SQL语句可以用来执行各种各样的操作,例如更新数据库中的数据,从数据库中提取数据等。