Re: ADO return varchar string with space trimmed
- From: "Daniel Crichton" <msnews@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Jul 2005 09:08:01 +0100
wdwedw wrote on Thu, 28 Jul 2005 12:42:10 -0700:
> I have a stored procedure like this:
> select CASE WHEN LEN(D1) < = 10
> THEN D1 + REPLICATE(' ', 10 - len(D1))
> ELSE LEFT(D1,10)
> END AS D1
> from table1
>
> When ADO retrieved the record in VB, the appended spaces were trimmed! I
> can work around with REPLICATE(N' ', 10 - len(D1)). But what's wrong?
A varchar defined field will strip appended spaces. CAST it as a char(10)
and the spaces will remain.
Dan
.
- Follow-Ups:
- Re: ADO return varchar string with space trimmed
- From: wdwedw
- Re: ADO return varchar string with space trimmed
- References:
- ADO return varchar string with space trimmed
- From: wdwedw
- ADO return varchar string with space trimmed
- Prev by Date: RE: 0x80020008 error
- Next by Date: When to switch from SWITCH() to JOIN
- Previous by thread: ADO return varchar string with space trimmed
- Next by thread: Re: ADO return varchar string with space trimmed
- Index(es):
Relevant Pages
|
|