Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @groupCount int = 1;
- WHILE @groupCount <= (
- SELECT COUNT(*) FROM dbo.Группы
- )
- BEGIN
- DECLARE @groupId int = (
- SELECT TOP 1 Номер
- FROM dbo.Группы
- WITH(INDEX(@groupCount))
- );
- DECLARE @subjectCount int = 1;
- WHILE @subjectCount <= (
- SELECT COUNT(*) FROM dbo.Предметы
- )
- BEGIN
- DECLARE @subjectId int = (
- SELECT TOP 1 ID
- FROM dbo.Предметы
- WITH(INDEX(@subjectCount));
- INSERT INTO dbo.Изучение (
- Группа_Номер,
- ID_Предмета,
- Часы,
- Вид_аттестации
- )
- VALUES (
- @groupId,
- @subjectId,
- 144,
- 'Экзамен'
- );
- SET @subjectCount = @subjectCount + 1;
- END;
- SET @groupCount = @groupCount + 1;
- END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement