Skip to Content.
Sympa Menu

freetds - Re: [freetds] MSSQL Server 2005 - select [field] AS [name] does not work?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Neil Whitaker <NWhitaker AT acornstairlifts.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] MSSQL Server 2005 - select [field] AS [name] does not work?
  • Date: Tue, 15 May 2012 15:21:29 +0000

> -----Original Message-----
> From: freetds-bounces AT lists.ibiblio.org [mailto:freetds-
> bounces AT lists.ibiblio.org] On Behalf Of James K. Lowden
> Sent: 15 May 2012 15:27
> To: freetds AT lists.ibiblio.org
> Subject: Re: [freetds] MSSQL Server 2005 - select [field] AS [name] does not
> work?
>
> On Tue, 15 May 2012 10:56:42 +0000
> Neil Whitaker <NWhitaker AT acornstairlifts.com> wrote:
>
> > You can see it should be [The_Key] => 1
> >
> > It's reproducible - and I have access to two servers (one with FreeTDS
> > 0.82, the other with 0.91) - both exhibit this behaviour.
>
> If you get the correct answer to the same query with isql or bsqlodbc, you
> might want to report the problem to the PHP project. IIRC this has been
> reported before and owes to PHP using the wrong property for the column
> name.
>
> --jkl
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds

Hi,

It's a bit of a strange one as you can't very easily search for it ('AS'
isn't the best keyword to try and find!), I tried it using isql, and it does
work:

SQL> select TOP 10 [EnquiryID] AS [Pri_Key] FROM [db].[dbo].[table];
+------------+
| Pri_Key |
+------------+
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
+------------+
SQLRowCount returns 10
10 rows fetched

So does this support your suggestion? It's worked with FreeTDS which shows
it's getting the right data, but when used with PHP it's munging the wrong
field names?

Cheers

Neil
If you are not the intended recipient, please notify the sender immediately
by replying to the e-mail, and then delete it without making copies or using
it in any way. Although any attachments to the message will have been checked
for viruses before transmission, you are urged to carry out your own virus
check before opening attachments, since Acorn Stairlifts accepts no
responsibility for loss or damage caused by software viruses.




Archive powered by MHonArc 2.6.24.

Top of Page