Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

readme.md

Exercises for bit manipulation T-SQL functions in SQL Server 2022

Follow these steps for exercises for bit manipulation functions in SQL Server 2022

Prerequisites

  • SQL Server 2022 Evaluation or Developer Edition
  • VM or computer with 2 CPUs and at least 8Gb RAM.
  • SQL Server Management Studio (SSMS). The latest 18.x build or 19.x build will work.

Steps to run the exercises

  1. Execute the script getbits.sql to see how the BIT_COUNT() AND GET_BIT() functions work.

  2. Execute the script packbits.sql to see how the RIGHT_SHIFT() and LEFT_SHIFT() and SET_BIT functions work.

    Note in the scripts you will sometimes see the LEFT_SHIFT() AND << in back to back statements. The same for RIGHT_SHIFT() AND >>. This is just to demonstrate two ways of doing the same thing.