• I like the suggestions, and the ability to attach a SQL query output to an email.

     

    I know the following works - EXEC ('master..xp_cmdshell ''isql /o' + @filename + ' /d' + @database + ' /Q"' + @sqlquery + '" /E''')

     

    But the only problem with the above is that you need SYSADMIN access to run XP_CMDSHELL

     

    I also do NOT want to use XP_SENDMAIL as it uses MAPI .

     

    Is there any other way to attach SQL queries to an email ??