见鬼了,高手请来,分不够可另开贴给。
huolx 2004-05-07 05:45:28 起因:我想读取列的描述。
根据 zjcxc(邹建)的回答,用
SELECT 字段名=article.name,字段说明=isnull(g.[value],'')
FROM syscolumns article
left join sysproperties g on article.id=g.id and article.colid=g.smallid
where article.id=object_id('article')
and article.name in('title','sourcetype')
article是表名,title,sourcetype是字段名,得到的结果是
sourcetype True
sourcetype 2
sourcetype 1033
sourcetype False
sourcetype 0
sourcetype -1
sourcetype False
sourcetype ய䡮₊輚輽愆
sourcetype 文章来源类别
sourcetype 109
sourcetype 1
sourcetype 3
sourcetype sourcetype
sourcetype 2
sourcetype False
sourcetype 50
sourcetype sourcetype
sourcetype article
sourcetype 10
sourcetype True
title False
title 2
title 1033
title False
title 0
title -1
title False
title ⛀㤢䘜宵황䏹熉
title 标题,题目
title 109
title 1
title 3
title title
title 1
title False
title 50
title title
title article
title 10
title True
正常的结果应是
sourcetype 文章来源类别
title 标题,题目
后来又试了几次,发现在其他数据库上均可正常运作,唯独在我开始测试的这个数据库上出现异常,这个数据库是我现在网站所用数据库,平时运作很正常。
仔细对比了一下区别,我发现系统表sysproperties似乎有些不正常,有2810条数据,别的数据库一般才几十条。
请高手出手!谢谢