decompress() function

The decompress() function decompresses a previously compressed varchar or nvarchar value.

Important: To process nvarchar values, you should use the compress_nvarchar() function instead of the compress() function and the decompress_nvarchar() function instead of the decompress() function. The compress() function remains for compatibility with earlier versions and results, but tables and views that store compress('NVARCHAR') function values might encounter problems during loads and GENERATE STATISTICS operations.

Syntax

The decompress() function has the following syntax:
varchar = decompress(varchar input);
nvarchar = decompress(nvarchar input);

The input value specifies the compressed varchar or nvarchar value to decompress.

Returns

The function returns the decompressed value.

Example

select decompress (compress('1234567890'));
 DECOMPRESS
------------
 1234567890
(1 row)