select a.name from syscolumns a join systypes b on a.xtype=b.xusertype where b.name='uniqueidentifier' and a.id=object_id('表名') 以上的方法是否限于GUID字段的类型是uniqueidentifier的,若设置的是VARCHAR呢? 就改成:select a.name from syscolumns a join systypes b on a.xtype=b.xusertype where b.name='VARCHAR' and a.id=object_id('表名')不管你是想查询什么的。只要把b.name='你要查询的类型'select a.name from syscolumns a join systypes b on a.xtype=b.xusertype where b.name='你要查询的类型' and a.id=object_id('表名')
select a.name from syscolumns a join systypes b on a.xtype=b.xusertype where b.name='VARCHAR' and a.id=object_id('表名') 如果写成上面那样,其不是把表中所有的VARCHAR类型的字段都找到了?可我要的是内容是GUID的啊?
select a.name from syscolumns join systypes b on a.xtype=b.xtype
where b.name='uniqueidentifier' and a.id=object_id('表名')
以上的方法是否限于GUID字段的类型是uniqueidentifier的,若设置的是VARCHAR呢?
就改成:select a.name from syscolumns a join systypes b on a.xtype=b.xusertype where b.name='VARCHAR' and a.id=object_id('表名')不管你是想查询什么的。只要把b.name='你要查询的类型'select a.name from syscolumns a join systypes b on a.xtype=b.xusertype where b.name='你要查询的类型' and a.id=object_id('表名')
如果写成上面那样,其不是把表中所有的VARCHAR类型的字段都找到了?可我要的是内容是GUID的啊?