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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Xp_sendmail, adding spaces in query output

Status
Not open for further replies.

SPIKEY2

Programmer
Feb 14, 2003
3
GB
Using SQL Server 2000 Service Pack 2 Build 2195

using xp_sendmail with code :
EXEC master.dbo.xp_sendmail @recipients = 'mailbox',
@query = 'SELECT creditdetails FROM ic_creditcards.dbo.uk_credits_20030213',
@message = '',
@subject = '',
@width=100, @no_header='TRUE', @attach_results = 'TRUE'

Creditdetails column contains for example:
"9999","999999999999","E1"," 9999","9999999999999999","999999999999","3290","",""

Use to send attachment with 82 characters in length, which is what I would expect and want. After sp applied it adds one blank character at the beginning of each row and two at the end. Tried trimming the column (does nothing), tried setting width to 82 but only adds to the problem (adds line feeds). Looked at settings but can't find anything that would dictate this behaviour. Any ideas?
 
Found a work around. Bcp and email with attachment file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top