select name from sysobjects where xtype = 'TR'

解决方案 »

  1.   

    楼上的朋友,我是相获取表和触发器对应的名称,好比我有一个USERMSG表,在这表上建立了一个T_USERMSG触发器,我要显示表名:触发器名这样就要以打出那些表建有触发器,哪些没有?请指教。
      

  2.   

    select a.name,b.name
    from sysobjects a , sysobjects b
    where a.id = b.parent_obj 
          and a.xtype = 'u' and b.xtype = 'tr'
      

  3.   

    或者:
    select a.name,isnull(b.name,'无触发器')
    from sysobjects a left outer join sysobjects b
    on a.id = b.parent_obj and b.xtype = 'tr'
    where a.xtype = 'u'
    order by a.name