With this stored procedure (SQL Server):
ALTER PROCEDURE [dbo].[fill_table1]
@CreatedBy nvarchar(max) = NULL
AS
BEGIN
SET NOCOUNT ON;
SELECT
[IdExchangeRate] = NEWID(),
[ExchangeRateCode] = 'EUR',
[ExchangeRatePeriodStartDate] = period,
[ExchangeRatePeriodEndDate] = EOMonth(period),
[ExchangeRateValue] = B.Value,
[CurrencyCode] = A.[Currency Code],
[CreatedBy] = 'string',
[CreatedAt] = GETUTCDATE()
FROM
[TempExchangeRates] AS A
CROSS APPLY
(SELECT
period = TRY_CONVERT(date),
Value = TRY_CONVERT(float, value)
......) B
END
I want to insert this output (+100rows) into another table (table2). I tried but it inserts just one row.