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