Posts

Showing posts with the label RIGHT_SHIFT

What is new in the CTP 2.1 of SQL Server 2022? New T-SQL commands!

Image
Hi guys, It's time for news,  the new CTP 2.1 of SQL Server 2022 has just been released. Let's see together what are the innovations introduced. Enjoy!     SQL Server 2022 CTP 2.1   I love talking about T-SQL commands and so I'm happy to show you the new T-SQL commands just added with this latest CTP (community technical preview)  Bit Manipulation functions Bit manipulation functions are introduced perhaps to match other database engines such as mysql. They could be useful in certain areas   Now we have a LEFT_SHIFT function.   Through this function we can shift the bits of an integer to the left. There are 2 parameters. the input decimal value and the number of bit to shift.   For example: select LEFT_SHIFT (256,1) Heres the result: Rememeber that shifting one bit to the left is equal to multiply the initial value by 2 . The RIGHT_SHIFT function instead shift bits to the right.  Shifting to the right is equivalent to divide by 2. ...