Select case when isnullable = 0 then '不允许空' else '允许空' end 
from syscolumns where name = 'yourFieldName'

解决方案 »

  1.   

    select d.name,a.name ,b.name ,a.length, a.isnullable from syscolumns a, systypes b,sysobjects d where a.xtype=b.xusertype and a.id=d.id and d.xtype='U'
      

  2.   

    哈哈,第一次到SQL版发贴。早闻大力的大名。今天见识,果然厉害。不过,上面的语句要稍微改进一下,就很完美了。谢谢大力,谢谢不做技术高手。select d.name as tablename,a.name as fieldname ,b.name  as fieldtype,a.length, a.isnullable from syscolumns a, systypes b,sysobjects d where a.xtype=b.xusertype and a.id=d.id and d.xtype='U'