I am working with Microsoft SQL Server MANAGMENT STUDIO 18 and i Have 2 Tables , i want to insert a new line of values from Table 1 on Table 2 but every time that a Value From Table 1 change from False to True .
Actually it works but only if i execute to This Program that i wrote
INSERT INTO Table2 ( Datum , Zeit, Temperatur , Oxidationszeit )
SELECT dbo.V_Table1.Value , V_Table1.Value , V_Table1.Value , V_Table1.Value
FROM dbo.V_Table1 CROSS JOIN
dbo.V_Table1 AS V_Table1_1 CROSS JOIN
dbo.V_Table1 AS V_Table1_2 CROSS JOIN
dbo.V_Table1 AS V_Table1_3
WHERE (dbo.V_Table1.ConfigID = 248)AND (V_Table1_1.ConfigID = 249) AND (V_Table1_2.ConfigID = 163) AND (V_Table1_3.ConfigID = 174)
My question is how can i add an If conditon or a trigger so that :
every time that a Value From Table 1 change => a new Line automatically is added to Table 2 with the value that i need
i will be grateful if someone can help me.