title: How to discover trigger's parent schema?
body: <p>To discover all triggers in any given MS SQL Server database, I'm currently querying the sysobjects table (which is fine because it works in MS SQL Server 2000 which I have to support) e.g. </p>
  
  <pre><code>SELECT R1.name AS trigger_name, 
         T1.name AS trigger_parent_table_name
    FROM sysobjects AS R1 
         INNER join sysobjects AS T1 
            ON R1.parent_obj = T1.id 
   WHERE R1.xtype = 'tr';
  </code></pre>
  
  <p>This gives me a reduced list of trigger names and for each I can use</p>
  
  <pre><code>EXEC sp_helptext 'trigger_name_here' 
  </code></pre>
  
  <p>to find the definition. That works fine for databases where only the default dbo schema is used.</p>
  
  <p>I now have a MS SQL Server 2005 database which uses multiple schemas. What is the best way of discovering the schema for each trigger?</p>