The sp_statement_completed returns a column called object_type. When the contents of that column are in (PROC, FUNCTION, TABFUNC) the object_id returns a non null value with OBJECT_NAME(object_id) function. When the object_type column values are in (PREPARED, ADHOC) the OBJECT_NAME function returns null. This event (sp_statement_completed) identifies statements in a procedure that have ended so how do I identify what procedure these prepared and adhoc statements are in?
Where can I find a complete description of the values in the object_type column?