We usually use the trace captured by crmdiagtool4 released by Microsoft to troubleshoot errors. We can use the following SQL script code to find out which object the guid in the trace comes from, so as to help us quickly solve the problem.
/* This script will be slow to run and is a 2 step process but functionality exists */
/* Compile enhancements cocould be made to make this a better script, time allowing */
/**/
/* Finds a string value in all tables and replaces it with another string */
/* Date created: 9/30/2003 CVA */
Declare @ tablename char (256)
Declare @ columnname char (256)
Declare @ findstring char (256)
Declare @ SQL char (8000)
/* Replace X with character (s) You which to find and Y with its replacement */
Set @ findstring = '{5e90da7d-51d8-4d8c-9582-eead2b43b0d6 }'
/* Select O. Name, C. name from syscolumns C inner join sysobjects o
On O. ID = C. ID
Where o. xtype = 'U '*/
Declare t_cursor cursor
Select O. Name, C. name from sysobjects o inner join syscolumns C
On O. ID = C. ID
Where o. xtype = 'U' and C. xtype in (36) -- for guid
Open t_cursor
Fetch next from t_cursor into @ tablename, @ columnname
While (@ fetch_status <>-1)
Begin
Set @ SQL = 'if exists (select * from ['+ rtrim (@ tablename) +'] where' + rtrim (@ columnname) + '= ''' + rtrim (@ findstring) + ''')
Begin
Print ''table = '+ rtrim (@ tablename) + 'column =' + rtrim (@ columnname) + '''
End'
-- Print @ SQL
Exec (@ SQL)
Fetch next from t_cursor into @ tablename, @ columnname
End
Close t_cursor
Deallocate t_cursor