Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Bit wise Operators in SQL Script

$
0
0

Actually I did it but I would like to make Rotation Left Shift, and I did find solution yet

I find this code on T-SQL but I 'm still trying to convert it in SQLScript

 

-- Rotate bits left
CREATEFUNCTION dbo.md5_bitrol
(
@x INT,
@s INT
)
RETURNSINT

BEGIN
    RETURNCONVERT(INT,SUBSTRING(CONVERT(BINARY(8), CONVERT(BIGINT, CONVERT(BINARY(4), @x)) * POWER(2, @s)), 5, 4)) | CONVERT(INT,SUBSTRING(CONVERT(BINARY(8), CONVERT(BIGINT, CONVERT(BINARY(4), @x)) / POWER(2, 32 - @s)), 5, 4))
END
GO


Any Ideas ?


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>