Skip to content

Commit 46f4f75

Browse files
committed
Create 004_student_category.sql
1 parent af197fc commit 46f4f75

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ALTER TABLE [sfa].[student_category] ADD [sort_order] INT NULL;
2+
GO
3+
4+
DECLARE @uq VARCHAR(200)
5+
SET @uq = (SELECT top (1) name FROM sys.objects WHERE type = 'UQ' AND OBJECT_NAME(parent_object_id) = N'student_category');
6+
EXEC('ALTER TABLE [sfa].[student_category] DROP CONSTRAINT ' + @uq)
7+
GO
8+
9+
UPDATE [sfa].[student_category] SET [sort_order] = 99;
10+
UPDATE [sfa].[student_category] SET [is_active] = 0;
11+
12+
INSERT INTO [sfa].[student_category] ( [code], [description], [sort_order], [is_active])
13+
VALUES ('IND', 'I have not been out of high school for more than 4 years, but I have been in the labour force for two periods of 12 consecutive months', 4, 1)
14+
15+
UPDATE [sfa].[student_category] SET [sort_order] = 1, [is_active] = 1, [description] = 'I am married/common-law' WHERE [id] = 2;
16+
UPDATE [sfa].[student_category] SET [sort_order] = 2, [is_active] = 1, [description] = 'I am a single parent' WHERE [id] = 8;
17+
UPDATE [sfa].[student_category] SET [sort_order] = 3, [is_active] = 1, [description] = 'I have been out of high school for more than 4 years' WHERE [id] = 9;
18+
UPDATE [sfa].[student_category] SET [sort_order] = 5, [is_active] = 1, [description] = 'I have not been out of high school for more than 4 years' WHERE [id] = 1;

0 commit comments

Comments
 (0)