Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

output formatting using sp_send_dbmail

Status
Not open for further replies.

Crowley16

Technical User
Jan 21, 2004
6,931
GB
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:
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top