SELECT * FROM sys.syslanguages
GO
DECLARE @langid int = 6 -- Italian
-- use row_number without an order by using (select 0) ...
-- needed for dropdownlist select options where value =id (row_number)
-- create two temporary tables with bogus row numbers as ID then join them together
SELECT row_number() over(order by (select 0)) AS [ID]
, item AS [ShortMonth]
, CAST(N'' AS nvarchar(20)) AS [Month]
INTO #T
FROM [dbo].[CSV2Table]( (SELECT shortmonths
FROM sys.syslanguages
WHERE langid= @langid)
, ',')
SELECT row_number() over(order by (select 0)) AS [ID]
, item AS [Month]
INTO #T2
FROM dbo.[CSV2Table]( (SELECT months
FROM sys.syslanguages
WHERE langid= @langid)
, ',')
-- Perform an INNER JOIN Update based on the bogus IDs
UPDATE #T SET Month = #T2.Month
SELECT * FROM #T
DROP TABLE #T
DROP TABLE #T2