Question : To generate combinations.

Sql Server 2005

I am trying to create all two digit combination of [0-9] and [A-Z] with t-sql.

I have tried but there are many missing combinations. I think the total number of rows should be
(26+10)*(26+10) = 1296

Where am I wrong?

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
with cteN as
( select fabric_type = '0' union select '1' 
  union select '2' union select '3' union select '4' union select '5'
  union select '6' union select '7' union select '8' union select '9')
, cteL as
( select fabric_type = 'A' 
union select 'B' 
union select 'C' 
union select 'D' 
union select 'E' 
union select 'F' 
union select 'G' 
union select 'H' 
union select 'I' 
union select 'J' 
union select 'K' 
union select 'L' 
union select 'M' 
union select 'N' 
union select 'O' 
union select 'P' 
union select 'Q' 
union select 'R' 
union select 'S' 
union select 'T' 
union select 'U' 
union select 'V' 
union select 'W' 
union select 'X' 
union select 'Y' 
union select 'Z' 
),
cteAll as
(SELECT fabric_type = CteL.fabric_type + cteN.fabric_type
from cteL
cross join cteN
)
select *
from cteAll
order by 1

Answer : To generate combinations.

Don't use quotes around the hex string. It is not a text string, but  hex encoded binary data.
Random Solutions  
 
programming4us programming4us