• Thanks for getting back ,

    so something like this ?

    EXEC msdb.dbo.sp_send_dbmail

    @recipients = 'me@email.org',

    @query = 'select FName as first,

    LName as last

    from client where LName = ''wilson'' ''

    for xml path(''Referral'')

    ROOT(''CLUB'')',

    @execute_query_database = 'execute_query_database', <-- NOT SURE what goes here ???

    @attach_query_result_as_file = 1,

    @body = 'The stored procedure finished successfully.',

    @subject = 'Automated Success Message'

    @attach_query_result_as_file = 1 makes it an attachment, what if I wanted to name it?

    Thanks

    Joe