Trying to create a temp table where the AlphaSeq column would go through an "array" of alphanumeric characters that do not repeat and follow a flow as shown in the example below.
Example:
| AlphaSeq | NumericSeq |
|---|---|
| A | 1 |
| A1 | 2 |
| B | 3 |
| B1 | 4 |
| AA | 5 |
| AB | 6 |
| BA | 7 |
| BB | 8 |
| [ETC] | [ETC] |
Here's what I have so far (Obviously the "IG" is static as it is written now, so Im trying to make that field more fluid)
CREATE TABLE #Index
(
AlphaSeq VARCHAR(2),
NumericSeq TINYINT
)
DECLARE @ArrayNum AS TINYINT;
DECLARE @ReceiptSeq AS VARCHAR(2);
SET @ArrayNum = 0
SET @ReceiptSeq = 'IG'
WHILE @ArrayNum < 100
BEGIN
SET @ArrayNum = @ArrayNum + 1
INSERT INTO #Index (AlphaSeq, NumericSeq)
VALUES (@ReceiptSeq, @ArrayNum)
END
SELECT *
FROM #Index
CROSS JOINthem to each other.