COMPRESS

  • Comments posted to this topic are about the item COMPRESS

  • Interesting question Steve, thanks. And learned something new.

    ...

  • This was removed by the editor as SPAM

  • Bellissimo!

    😀

  • The SQL Server database engine, replacing application code since 2005... 😀

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I had never heard of this, probably because I haven't touched SQL 2016. Learned something new, thanks.

  • > Correct answer: This function returns a GZip compressed version of the string.

    I disagree with the answer.

    COMPRESS can return a GZip compressed version of the string, but it does not have to.

    According to MSDN https://msdn.microsoft.com/en-us/library/cc280449.aspx

    "SQL Server 2016 supports row and page compression for rowstore tables and indexes, and supports columnstore and columnstore archival compression for columnstore tables and indexes."

    Also from same article,

    "Data can also be compressed using the GZIP algorithm format. This is an additional step and is most suitable for compressing portions of the data when archiving old data for long term storage. "

    Irregardless, good question that made me learn something new.

    Thanks.

    Bruce

  • Bruce Dow (1/26/2016)


    > Correct answer: This function returns a GZip compressed version of the string.

    I disagree with the answer.

    COMPRESS can return a GZip compressed version of the string, but it does not have to.

    According to MSDN https://msdn.microsoft.com/en-us/library/cc280449.aspx

    "SQL Server 2016 supports row and page compression for rowstore tables and indexes, and supports columnstore and columnstore archival compression for columnstore tables and indexes."

    Also from same article,

    "Data can also be compressed using the GZIP algorithm format. This is an additional step and is most suitable for compressing portions of the data when archiving old data for long term storage. "

    Irregardless, good question that made me learn something new.

    Thanks.

    Bruce

    WHile it is true that SQL Server supports all those compression algorithms (and even a few more), that has nothing to do with the question.

    The question is about the COMPRESS function. And as you can read on the link in the explanation, that function will always return a GZip compressed version of the input. The other compression methods are used internally but not expised in the COMPRESS function.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Wish I was on the newest version.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply