364,111 Members | 2078 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

Send formated query result by mail

Rolf Kemper
P: n/a
Rolf Kemper
Dear Experts,

I want to send a formated query result by mail.
I'm running SQL Server 2000

1) How can I achieve that the printed length of a field is based on
the minimum required length to show the stored data uncut( Means the
fieldlength is the maximum required length found in all items of a
column ) ?


What I'm looking for is like this ones

A) SELECT @MailString = @MailString + REQUIRED_LENGTH(column_name1 ,
alias ) + REQUIRED_LENGTH(column_name2 , alias2 ) , ... + @CRLF
FROM tab.


B) @MailString = NICE_PRINT('SELECT column_name1 as 'alias1' ,
column_name2 as 'alias2' , ... FROM tab')

Approach A is probably very inefficient.
Approch B is probably more complex

I guess many of you have solved that problem already.
Every tip , example or hint is highly welcome.

Thanks a lot
Rolf
Jul 20 '05 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Help answer this question



Didn't find the answer to your Microsoft SQL Server question?

You can also browse similar questions: Microsoft SQL Server