Powershell command (whitespace added for readability):
Invoke-Sqlcmd -ServerInstance "$db" -Database "$dbname" -Username "xxxx" -Password "xxx" -Query "select logmessages from log where TIME_STAMP BETWEEN '2019-01-11 09:00:00' and '2019-01-11 09:02:00' AND logmessages like '%string%' order by TIME_STAMP" -QueryTimeout 0 -ConnectionTimeout 0 | Export-Csv "C:\Users\xxxxx\Desktop\PS\data.csv" -Append
Each row result is expected to be around 01 mb. The problem is I'm seeing partial data.
The table has 17 columns and I'm trying to fetch data from one of the column (type:varchar; length: -1) which typically stores xml data close to the size of 1mb per record. When I run a select statement against that column, only partial data is returned.