EXEC msdb.dbo.sp_send_dbmail
@profile_name = 'U4 Notifications.com'
,@recipients = 'test@test.com'
,@subject = 'Circuits missing a CLLI Code - Process Z4026 - "Garbage man cometh"'
,@attach_query_result_as_file = 1
-- can go to 32767 for query width
,@query_result_width = 32767
,@body_format = 'TEXT'
,@body = 'blah blah blah test message
'
,@append_query_error = 0
,@exclude_query_output = 0
,@query_no_truncate = 0
,@query = 'SELECT ANI = Left(ANI,12) FROM [Billing Automation Processes].dbo.[Z4026 - Circuits missing CO information]'
ASKER
ASKER
Microsoft SQL Server 2005 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. It includes support for managing XML data and allows a database server to be exposed over web services using Tabular Data Stream (TDS) packets encapsulated within SOAP (protocol) requests.
TRUSTED BY
but, you can select a wide varchar line and make each line of the CSV yourselves.
Something like select convert(varchar(10),attrib
write it to a file and give it an explicit filename like @query_attachment_filename