DECLARE @Event_ID int
DECLARE my_cursor CURSOR FOR
SELECT Event_ID FROM ITS_CALENDAR_EVENTS_LIST
WHERE EVENT_SA_Flag = 1
OPEN my_cursor
FETCH NEXT FROM my_cursor
INTO @Event_ID
WHILE @@FETCH_STATUS = 0
BEGIN
INSERT INTO ITS_CALENDAR_EVENTS_TO_FLAGS (Event_ID, Event_Flag_ID)
VALUES (@Event_ID, 1)
FETCH NEXT FROM my_cursor
INTO @Event_ID
END
CLOSE my_cursor
DEALLOCATE my_cursor
Tsql loop
最新推荐文章于 2021-10-14 20:50:36 发布