Solved

Xp_Sendmail not mailing Ascii

Posted on 2011-09-14
4
561 Views
Last Modified: 2012-07-21
I have a process that does a simple select. Once it does this select, it executes the XP_Sendmail to a .csv, but the problem is the .csv file needs to be in ascii format, its defaulting to uuincode

Any Help?

0
Comment
Question by:sysadmn_ascent
  • 2
4 Comments
 
LVL 17

Expert Comment

by:dbaSQL
ID: 36542369
have you tried to use sp_send_dbmail?  it may not be a problem with xp_sendmail.  how are you creating the file?
http://dbaspot.com/sqlserver-server/369348-why-does-xp_sendmail-always-creates-using-unicode.html
0
 
LVL 21

Accepted Solution

by:
Alpesh Patel earned 500 total points
ID: 36542596
yes use the Database Mail. First configure it and use it
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 36546776
If you are running the query via the email then it makes little difference. The result will be unicode. At one point it used to generate Ansi / Ascii output but with the various upgrades it lost that ability and became unicode by default.

It has been some time since I last looked into it, and would have hoped there was an option by now. But cursory checks suggest it is still unicode output. I can check further if needed.

Possibly the best way is to generate the output and attach the results rather than attach the query. This is also true for dbmail.

Also, if using SQL 2005 and later, then most definitely look at the newer tools with dbmail - even though attached queries will still generate unicode, it is a far better tool (in my opinion).

But, execute the query first, generate the attachment, then attach that (and not the query).

If you can give us an example of what you are currently doing (and versions), we might be able to suggest the more appropriate solution.
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 38211609
Strange... Would have though dbasql might have earned some points given the accepted solution.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL: Get Holding Day Based On Transfer Date And Return Date 13 70
SQL Log size 3 17
TSQL XML Namespaces 7 22
RESTORE MASTER DATABASE -- NOW 2 19
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question