Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @GroupID INT, @SubjectID INT
- DECLARE GroupCursor CURSOR FOR
- SELECT Номер
- FROM Группа
- OPEN GroupCursor
- FETCH NEXT FROM GroupCursor INTO @GroupID
- WHILE @@FETCH_STATUS = 0
- BEGIN
- DECLARE SubjectCursor CURSOR FOR
- SELECT ID
- FROM Предметы
- OPEN SubjectCursor
- FETCH NEXT FROM SubjectCursor INTO @SubjectID
- WHILE @@FETCH_STATUS = 0
- BEGIN
- INSERT INTO Изучение (Группа_Номер, ID_Предмета, Часы, Вид_аттестации)
- VALUES (@GroupID, @SubjectID, 144, 'Экзамен')
- FETCH NEXT FROM SubjectCursor INTO @SubjectID
- END
- CLOSE SubjectCursor
- DEALLOCATE SubjectCursor
- FETCH NEXT FROM GroupCursor INTO @GroupID
- END
- CLOSE GroupCursor
- DEALLOCATE GroupCursor
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement