Topic Thread

Last byte of data corrupted on larger NVARCHAR

  • 1.  Last byte of data corrupted on larger NVARCHAR

    Posted Wed February 12, 2020 03:22 PM
    I'm working on a new archiving request against SQL Server and I ran into an issue against a NVARCHAR(MAX) column. Optim will select all the data...but the last byte is getting changed/corrupted. In our case, it is being changed to an Asian character set. Any attempt to browse this data immediately abends and issues some weird error of "nCount != 0" and then the Optim browse file session crashes. 

    I was able to restore the data and then saw that the issue was the last character had been corrupted. I started playing around with the data by Sub-stringing the column to see if smaller data lengths would function properly. If I only have a few thousand bytes in the column, it can be browsed and the data is not corrupted. Once it gets over about 12K bytes, the data appears to get corrupted in the last byte. 

    Wondering if anyone has hit similar issues with odd behavior against NVARCHAR(MAX) in SQL Server? 

    We are running Optim on Windows Server 2012 R2
    SQL Server 2012
    NVARCHAR(MAX) with average length of about 200KB

    Appreciate the input on this.

    Keith Tidball
    Progressive Insurance