_QueryText Compression
tfowles
Posts: 2 New member
I am trying to do some analysis on our queries (specifically, long-running and blocking queries). I see in the forums in a number of places that the _QueryText column is compressed with GZIP compression. I am attempting to decompress it with no luck. Has something changed in more recent versions? Any chance someone could point me to something that could help me out with this? Thanks!
Tagged:
Answers
It should be the same as the DECOMPRESS() function in SQL Server 2016 and later. I've attached a .sql script (renamed to .txt so I could attach it here) that will create a similar function to decompress. It adds it in the utils schema of the SQL Monitor data repository.
Have you visited our Help Center?
I was also able to DECOMPRESS the field without the CLR. I thought I would add that here for anyone else trying to decompress these fields (as an alternative option):
CONVERT(VARCHAR(MAX), DECOMPRESS(CONVERT(VARBINARY(MAX), CONVERT(VARCHAR(MAX), <field>))))