A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Hi @Илья Листратенко ,
Welcome to Microsoft Q&A!
Please have a try with below and check whether it is helpful to you.
IF (@DateTimeNow_WeekDay_Check = 1
AND @DateTimeNow_Repeat_Check = 1)
BEGIN
INSERT INTO [ServicesLog]
SELECT *
FROM [ServicesConf]
WHERE [REPEAT] IS NOT NULL
and [ID] = @cnt --adding this row
END
IF (@DateTimeNow_WeekDay_Check = 1
AND @DateTimeNow_WeekHour_Check = 1)
BEGIN
INSERT INTO [ServicesLog]
SELECT *
FROM [ServicesConf]
WHERE [REPEAT] IS NULL
and [ID] = @cnt --adding this row
END
If above is still working, please provide the CREATE TABLE statements for your tables together with INSERT statements with sample data, and the expected result of the sample.
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.