Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

Undocumented uncompress() function behaves strangely

When evaluating the new feature compress() -> decompress() in Sql 2016 I accidentaly typed uncompress()
This function, or alias seem undocumented and compiles. But the results are invalid. It returns null values.
See the following example, where last row returns corrupt data.

declare @data varbinary(max) = (select compress(cast('text that will be lost forever' as varchar(max))))
select @data
select cast(decompress(@data) as varchar(max))
select cast(uncompress(@data) as varchar(max))

0 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    AdminMicrosoft SQL Server (Product Manager, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base