SQL Server - all possible combinations of Bit columns
问题 I have an empty table with 7 BIT columns (A, B, C, D, E, F, and G). I am looking to populate this table with rows representing all possible combinations of these columns. Ideally there would be no rows containing duplicates of the exact same combinations. Although I am showing 7 columns here, the number of columns could be greater, so the solution should be scalable. A snippet of the table after being populated would look similar to below: Ideally this would be based on an INSERT statement,