I need to insert @N rows with random float values into one table and use IDs of every new inserted row for another INSERT. All this I need to do in stored procedure. For example:
CREATE PROCEDURE Proc
@N int
AS
-- START LOOP, REPEAT @N TIMES
INSERT INTO [T1]
([Value])
VALES
(<random_float>)
INSERT INTO [T2]
([ValueID])
VALUES
(@@IDENTITY)
-- END LOOP
END
GO
Thanks in advance.
No loops, one insert