Skip to Content.
Sympa Menu

freetds - [freetds] Column Aliasing with MS SQL Server

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Derek Parnell" <ParnellD AT scc-fl.edu>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Column Aliasing with MS SQL Server
  • Date: Mon, 20 Jul 2009 15:47:33 -0400

Hello all,

I have configured a new server running SLES 10 and installed LAMP, along with
FreeTDS and unixODBC to connect to our MS SQL Server. I've copied the
odbc.ini, odbcinst.ini and freetds.conf from our old server to this new one.
Things are "almost" the same as before.

Before we could use column aliases for singular column names, for instance, a
query might be:

SELECT Descr AS Description FROM SomeTable;

Before, when calling odbc_fetch_array, we would get associative arrays with
the key names being "Description". However, now we get them called "Descr".

If I alter the query slightly to be
SELECT Descr + '' AS Description FROM SomeTable;

then the key names are actually "Description", as we want.

Also, when using isql to connect and run the first query above, everything
comes out as I expect, with the column names being Description.

Any and all help is appreciated.




Derek Parnell
Seminole Community College
Department of Computing and Telecommunication Services
100 Weldon Boulevard
Sanford, Florida 32773-6199
407.708.2355


Please Note:
Due to Florida's very broad public records law, most written communications
to or from College employees regarding College business are public records,
available to the public and media upon request. Therefore, this e-mail
communication may be subject to public disclosure.





Archive powered by MHonArc 2.6.24.

Top of Page