USE [yourDB]
GO
CREATE TABLE #TempTable (
ID INT IDENTITY(1, 1) NOT NULL,
X INT,
XTimes2 AS (X * 2),
XTimes3 AS (RIGHT(REPLICATE('0', 8) + LTRIM(X), 8))
)
DECLARE @IDs TABLE (
ID INT,
XTimes2 INT,
XTimes3 AS (RIGHT(REPLICATE('0', 8) + LTRIM(ID), 8))
)
INSERT #TempTable
OUTPUT inserted.ID,
inserted.XTimes2
INTO @IDs(ID, XTimes2)
SELECT number
FROM master..spt_values Val
WHERE Val.type = 'P'
AND Val.number BETWEEN 1
AND 5
SELECT * FROM @IDs
DROP TABLE #TempTable