SQLServer查询虚字段可以设置类型么
展开全部
这个可以在系统表里查syscolumns,查询语句如下 TypeName就是字段的类型,TableName是你要查询的表,sc.name是字段名,sc.length字段类型长度
select st.name as 'TypeName',sc.name,sc.length from syscolumns sc,systypes st where sc.xtype=st.xtypeand sc.id in(select id from sysobjects where xtype='U' and name='TableName')
select st.name as 'TypeName',sc.name,sc.length from syscolumns sc,systypes st where sc.xtype=st.xtypeand sc.id in(select id from sysobjects where xtype='U' and name='TableName')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询