You can use SQL Profiler and run a trace looking for the function's name in
the textdata column, you can raise a user configurable event from your
function with sp_trace_generateevent (which despite its sp_ prefix is an
extended procedure, so you can use it in a function) and trace that with
Profiler, or you can log a message from the function to the Windows Event
log with xp_logevent.
You can also work around the limitation of not being able to write to a
table, by calling osql, the SQL Server commandline utility, with
xp_cmdshell, or using the sp_OA procedures to call a COM component and let
that do the work.
My preferred solution would be to use sp_trace_generateevent, but you need
to give permissions to it first, as it defaults to members os the sysadmin
Jacco Schalkwijk MCDBA, MCSD, MCSE
"Arthur Hoornweg" <nl.net> wrote in message