November 13, 2008 at 5:06 am
Hi,
Can someone please tell me how to remove ------------ lines from output while sending query results via mail using xp_sendmail?
I need to send few columns in output from a simple select query to end user via mail.
Please help.
TIA,
MJ
November 14, 2008 at 7:09 am
If this is a recurring requirement, how about creating a report in Reporting Services, and then creating a subscription to it? If it's a one-time event, I'd say take the query output in grid mode within SSMS and then copy and paste the grid into Excel and format to your heart's content.
Steve
(aka smunson)
:):):)
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
November 14, 2008 at 6:43 pm
There's a really, really simple way to get simple returns from a query to look great... lookup sp_MakeWebTask. With a little effort, you can also turn out some absolutely astounding looking reports, without reporting services, by using and tuning templates. Like I said, lookup sp_MakeWebTask in Books Online.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 16, 2008 at 3:29 pm
Also, take a look at FOR XML PATH and formatting query results into an HTML table. I have several scheduled jobs set up that use this method of extracting and displaying data.
I started looking for alternative methods of displaying query results when trying to attach data as a query using database mail and encountering large amounts of blank space which appeared to be the result of "padding" where the data length was less than the field length.
🙂
November 17, 2008 at 6:03 am
Hey Jeff,
I was looking for the SP_MakeWebTask but the following appears on my screen.
sp_makewebtask is retained for backward compatibility. New Web pages are more easily created using Microsoft SQL Server 2005 Reporting Services (SSRS).
To execute sp_makewebtask you must be a member of the sysadmin fixed server role.
This feature will be removed in the next version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible.
wkr,
Eddy
November 17, 2008 at 6:05 pm
eddy (11/17/2008)
Hey Jeff,I was looking for the SP_MakeWebTask but the following appears on my screen.
sp_makewebtask is retained for backward compatibility. New Web pages are more easily created using Microsoft SQL Server 2005 Reporting Services (SSRS).
To execute sp_makewebtask you must be a member of the sysadmin fixed server role.
This feature will be removed in the next version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible.
wkr,
Eddy
Then, I guess you may be stuck with SSRS to do this. You could suppress all header info with a call to OSQL, but that would also require a call to xp_CmdShell.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply