Here's one way...
DECLARE @agentName varchar(15) = 'John Smith',
@agentEffectiveDate date = '4/1/2014',
@agentLocation varchar(5) = '85226',
@agentID varchar(7) = '12345'
CREATE TABLE #table
(
ID int IDENTITY(1,1) NOT NULL,
agentName varchar(15) NOT NULL,
agentEffectiveDate date NOT NULL,
agentLocation varchar(5) NOT NULL,
agentID varchar(7) NOT NULL,
dollarAmount money
PRIMARY KEY (agentName, agentID, agentLocation)
)
INSERT INTO #table (agentName, agentEffectiveDate, agentLocation, agentID)
VALUES (@agentName, @agentEffectiveDate, @agentLocation, @agentID)
DECLARE @table TABLE
(
FirstLetter VARCHAR(1) NOT NULL
,LastLetter VARCHAR(1) NOT NULL
,Value DECIMAL(10,2) NOT NULL
,UNIQUE CLUSTERED (FirstLetter,LastLetter,Value)
)
INSERT INTO @table
VALUES
('A','A',3)
,('A','G',5)
,('A','M',8)
,('A','R',72)
,('A','Y',12)
SELECT
a.ID
,a.agentName
,a.agentEffectiveDate
,a.agentLocation
,b.FirstLetter + a.agentID + b.LastLetter AgentID
,b.Value DollarAmount
FROM #table a
INNER JOIN @table b
ON 1 = 1
DROP TABLE #table