PHP and MSSQL with FreeTDS: SQL Server columns get truncated at 30 characters
Beware this content is over a year old and considered stale. It may no longer be accurate and/or reflect the understanding of the author but remains here for reference only. Please keep this in mind as you use this content.
If you’re using PHP 5 and MSSQL extension to retrieve data from Microsoft SQL Server and you’re seeing your columns truncated at around the 30 character mark, it could be down to your FreeTDS settings.
The quick and easy way to do this is simply to install the FreeTDS kitchen-sink which gives you access to further settings and generally better debugging support.
Then restart PHP and your web server, which in my case is nginx.
You may also have to explicitly define the TDS protocol version to use. Add TDS protocol version to:
Further helpful information here: