The title is a pretty good summary of what's going on. I have a php application built on Zend Framework 2 and running on CentOS using the pdo_dblib driver to connect to an MSSQL server for persistence.
I'm trying to store some rather long strings of encoded data into an nvarchar (max) column in one of the tables and thus far I have proven that I can successfully INSERT the data into the table. I have verified that the data stored is complete and correct by performing a SELECT query via a desktop C# app I wrote for debugging purposes.
However when I run the exact same SELECT query via the ZF2 Adapter (bypassed the query builder for debugging) I receive a truncated response, exactly 2048 characters in length. For reference, the test string is roughly 110kb in length.
I have similar table structures and queries in another app connected to MySql and have never seen this issue.
Any suggestions?
C# select
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
// Do work here; connection closed on following line.
using (SqlCommand command = new SqlCommand("select data from fil_tab where uid = 10", connection))
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
int value = reader.GetString(0).Count(); // value gives me the correct char count
}
}
}
The matching php
public function test(){
$test = $this->tableGateway->getAdapter()->query("select data from fil_tab where uid = 10");
$result = $test->execute()->current();
$value = strlen($result['data']); //2048 every time.
}