SELECT sys.objects.name AS 表名,sys.columns.name AS 列名,sys.types.name AS 数据类型 FROM sys.objects JOIN sys.columns ON sys.objects.object_id=sys.columns.object_id JOIN sys.types ON sys.columns.user_type_id=sys.types.user_type_id WHERE sys.objects.type='U' ORDER BY sys.objects.name,sys.columns.column_id
1.Sql语句查询: select a.name 表名,b.name 字段名,c.name 字段类型,c.length 字段长度 from sysobjects a,syscolumns b,systypes c where a.id=b.id and a.name='student' and a.xtype='U' and b.xtype=c.xtype 2.alter table 表名 alter column 字段名 varchar(18)