Hi Everyone.
I've got a little sproc which is used to send query results to various people.
However I'm having trouble getting it to format nicely, so have set the output to be an attached file, with an xls extention, using tab spacing.
This *almost* works, the only problem is that below the column headers, there is a line of '-----'.
So the question is, how can I get rid of these '-------'s.
The code I have is:
thanks
--------------------
Procrastinate Now!
I've got a little sproc which is used to send query results to various people.
However I'm having trouble getting it to format nicely, so have set the output to be an attached file, with an xls extention, using tab spacing.
This *almost* works, the only problem is that below the column headers, there is a line of '-----'.
So the question is, how can I get rid of these '-------'s.
The code I have is:
Code:
exec msdb.dbo.sp_send_dbmail
@profile_name='SomeProfile',
@body='See attached.',
@recipients='SomeAddress',
@subject='report',
@query='someQuery',
@attach_query_result_as_file=1,
@query_attachment_filename='results.xls',
@query_result_separator=@sep --@sep is char(9)
thanks
--------------------
Procrastinate Now!