title: Find table name in all objects of all databases
body: <p>I have a system with multiple databases and client applications. All databases are at one SQL Server instance. They have been developed by different people at different time. So if some error occur it is pritty hard to find in which procedure or trigger the data was modified.</p>
  
  <p>Now I use this script, which I found on this site:</p>
  
  <pre><code>SELECT  DISTINCT ISNULL(sd.referenced_schema_name+'.','')+ OBJECT_NAME(sd.referenced_id)TableName,
          OBJECT_NAME(sd.referencing_id)Ref_Object,
          CASE WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsUserTable')= 1
                       THEN'Table'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsTableFunction')= 1
                       THEN'Function'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsTableFunction')= 1
                       THEN'Function'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsScalarFunction')=1
                       THEN'Function'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsTrigger')= 1
                       THEN'Trigger'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsView')= 1
                       THEN'View'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsUserTable')= 1
                       THEN'Table'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsProcedure')= 1
                       THEN'Procedure'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsIndexed')= 1
                       THEN'Index'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsForeignKey')= 1
                       THEN'ForeignKey'
          WHEN OBJECTPROPERTYEX(sd.referencing_id,N'IsPrimaryKey')= 1
                       THEN'PrimaryKey'
          END AS Ref_Object_Name
  FROM    sys.sql_expression_dependencies SD
          INNER JOIN sys.objects obj
                       ON obj.object_id=sd.referenced_id
  WHERE   obj.is_ms_shipped= 0
          and referenced_id=object_id('TABLE_NAME') /*Where one can Replace table Name*/
          AND obj.type_desc='USER_TABLE'
          ORDER BY TableName,Ref_Object,Ref_Object_Name
  </code></pre>
  
  <p>But this script seems to work only for the database to which the table belong.</p>
  
  <p>I want to get for a specified table name (or even better for an object) list of all objects of all databases in which the specified table name met:</p>
  
  <pre><code>Database_Name  SchemaName  ObjectName  ObjectKind  
  </code></pre>
  
  <p>Thanks.</p>