• If you're using SQL Server 2005, wouldn't you do better to search sys.sql_modules?  That's the replacement for syscomments.  The definition column holds all the sql definitions, and is nvarchar(max).

    I imagine the object_definition() function simply queries that view, so you should get better performance by searching the view directly rather than using the function.