Okay, I think that I'm just going to have to face the fact that I'm an idiot. I had changed the textsize and textlimit properties in php.ini for MSSQL, but I missed the semicolon in the beginning of the lines. I just uncommented those two lines, and now it works like a charm.
; Valid range 0 - 2147483647. Default = 4096. mssql.textlimit = 2147483647 ; Valid range 0 - 2147483647. Default = 4096. mssql.textsize = 2147483647