I'm using SQL 2008 RS. Is it possible to perform a function like the code below? Obviously the code does not work but I think it makes it clear what I'm trying to do.
Select case when [GUEST_CHECK_NAME] = 'KJ Chardonnay' then
(EXEC msdb.dbo.sp_send_dbmail @profile_name='MFMail',
@body='GuestCheckName Test' )
from OPENXML(@hDoc,@ChkItemCheckItemsXpath) With
[GUEST_CHECK_NAME] [varchar](23) 'GuestCheckName'