Testdaten - hydropoc/website Wiki

USE HydroPoC;
TRUNCATE TABLE sensordata;
DECLARE @i INT = 1000;
DECLARE @time BIGINT = (CAST(DATEDIFF(s, '1970-01-01 00:00:00.000', CAST(SYSDATETIME() AS NVARCHAR(200))) AS BIGINT));
WHILE (@i > 0)
    BEGIN
        INSERT INTO sensordata (temperature_water, temperature_air, humidity, co2_level, ph_value, ec_value, swimmer_1, swimmer_2, swimmer_3, timestamp) 
        VALUES (
            (RAND()*2)+12, 
            (RAND()*3)+22, 
            (RAND()*4)+36,
            FLOOR(RAND()*600),
            FLOOR(RAND()*5),
            FLOOR(RAND()*10*10),
            FLOOR(RAND()*10*10),
            FLOOR(RAND()*10*10),
            FLOOR(RAND()*10*10),
            @time
        );
        SET @i = @i - 1;
        SET @time = @time -15;
    END