In SQL 2000, it's possible that the function can get renamed, and mess up the dependency chain because the names of the object in two different system tables do not match. To detect these functions, you could use the following query:
- Code: Select all
SELECT s.NAME, s.xtype, c.TEXT
FROM sysobjects s
INNER JOIN syscomments c ON s.id = c.id
WHERE s.NAME <> SUBSTRING(c.TEXT, CHARINDEX(s.name, c.TEXT), len(s.name)) AND (s.xtype = 'FN' OR s.xtype = 'TF')
If any results are found, you may want to script this function, then drop and recreate it. This will result in SQL that is consistent between syscomments and sysobjects.