﻿PRINT N'Dropping Extended Property [dbo].[T_TANULOTANUGYIADATOK].[C_ISATLAGNELKUL].[MS_Description]...';


GO
IF EXISTS ( SELECT * FROM INFORMATION_SCHEMA. COLUMNS WHERE TABLE_NAME = 'T_TANULOTANUGYIADATOK' AND COLUMN_NAME = 'C_ISATLAGNELKUL') 
EXECUTE sp_dropextendedproperty @name = N'MS_Description', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'T_TANULOTANUGYIADATOK', @level2type = N'COLUMN', @level2name = N'C_ISATLAGNELKUL';


GO
PRINT N'Altering Table [dbo].[T_TANULOTANUGYIADATOK]...';


GO
IF EXISTS ( SELECT * FROM INFORMATION_SCHEMA. COLUMNS WHERE TABLE_NAME = 'T_TANULOTANUGYIADATOK' AND COLUMN_NAME = 'C_ISATLAGNELKUL') 
BEGIN
    EXEC dev.uspDropDefaultConstraint @pTableName = 'T_TANULOTANUGYIADATOK', @pColumnName = 'C_ISATLAGNELKUL'
    ALTER TABLE [dbo].[T_TANULOTANUGYIADATOK]
    DROP COLUMN [C_ISATLAGNELKUL];
END

GO
IF NOT EXISTS ( SELECT * FROM INFORMATION_SCHEMA. COLUMNS WHERE TABLE_NAME = 'T_TANULOTANUGYIADATOK' AND COLUMN_NAME = 'C_ISATLAGNELKULI') 
BEGIN
    ALTER TABLE [dbo].[T_TANULOTANUGYIADATOK]
    ADD [C_ISATLAGNELKULI] CHAR (1) DEFAULT ('F') NOT NULL;
END
GO
PRINT N'Creating Extended Property [dbo].[T_TANULOTANUGYIADATOK].[C_ISATLAGNELKULI].[MS_Description]...';


GO
EXECUTE dev.uspAddOrUpdateExtendedProperty @name = N'MS_Description', @value = N'A tanuló rendelkezik-e az ösztöndíjhoz szükséges átlaggal.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'T_TANULOTANUGYIADATOK', @level2type = N'COLUMN', @level2name = N'C_ISATLAGNELKULI';

EXEC dev.uspCreateSchemaViews 'T_TANULOTANUGYIADATOK'
EXEC dev.sp_Global_GenerateAsyncAuditTriggerAll

GO
PRINT N'Update complete.';


GO
