Wednesday, March 7, 2012

How to get non-fixed-width results in xp_sendmail?

(SQL Server 2000, SP3a)
Hello, all!
I'm using xp_sendmail with the @.query parameter and a @.separator of ', ' with an
attachment.
The query works out great -- but all of my string data is "fixed width", with spaces at
the end of them when I look at it in Excel. (Like it was CHAR(X) instead of VARCHAR(X).)
I've verified that the table is what I think it is (using VARCHARs). I think this is just
a function of xp_sendmail and an attachment. Is there any way to get rid of this
fixed-width artifact?
Thanks!
John PetersonThere's an alternative to SQLMail you might like to consider :-
http://www.sqldev.net/xp/xpsmtp.htm
--
HTH
Ryan Waight, MCDBA, MCSE
"John Peterson" <j0hnp@.comcast.net> wrote in message
news:es$hDVhrDHA.360@.TK2MSFTNGP12.phx.gbl...
> (SQL Server 2000, SP3a)
> Hello, all!
> I'm using xp_sendmail with the @.query parameter and a @.separator of ', '
with an
> attachment.
> The query works out great -- but all of my string data is "fixed width",
with spaces at
> the end of them when I look at it in Excel. (Like it was CHAR(X) instead
of VARCHAR(X).)
> I've verified that the table is what I think it is (using VARCHARs). I
think this is just
> a function of xp_sendmail and an attachment. Is there any way to get rid
of this
> fixed-width artifact?
> Thanks!
> John Peterson
>|||Thanks, Ryan!
But, this alternative doesn't yet support the @.query type of operation, which I'm
currently relying on.
It seems to me that there ought to be *some* way to prevent the output from being in
fixed-width mode -- but for the life of me I cannot figure it out...
"Ryan Waight" <Ryan_Waight@.nospam.hotmail.com> wrote in message
news:O$Z7XOorDHA.1184@.TK2MSFTNGP10.phx.gbl...
> There's an alternative to SQLMail you might like to consider :-
> http://www.sqldev.net/xp/xpsmtp.htm
> --
> HTH
> Ryan Waight, MCDBA, MCSE
> "John Peterson" <j0hnp@.comcast.net> wrote in message
> news:es$hDVhrDHA.360@.TK2MSFTNGP12.phx.gbl...
> > (SQL Server 2000, SP3a)
> >
> > Hello, all!
> >
> > I'm using xp_sendmail with the @.query parameter and a @.separator of ', '
> with an
> > attachment.
> >
> > The query works out great -- but all of my string data is "fixed width",
> with spaces at
> > the end of them when I look at it in Excel. (Like it was CHAR(X) instead
> of VARCHAR(X).)
> >
> > I've verified that the table is what I think it is (using VARCHARs). I
> think this is just
> > a function of xp_sendmail and an attachment. Is there any way to get rid
> of this
> > fixed-width artifact?
> >
> > Thanks!
> >
> > John Peterson
> >
> >
>

No comments:

Post a Comment