Solved

Xp_Sendmail not mailing Ascii

Posted on 2011-09-14
4
531 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

705 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now