Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Send email functionality emailing the variable that contains the result of the query

Code Block
languagesql
USE msdb
EXECUTE AS USER = 'dbo'
EXEC msdb.dbo.sp_send_dbmail

@recipients=N'mgallant@logisense.com',
@body='See text attachment for billable users',

@subject ='5xSunrise Billable Users',
@profile_name ='Portal Check',
@query ='SELECT   * from boss.dbo.custombillablepackages',

@attach_query_result_as_file = 1,
@query_attachment_filename ='Results.txt'