﻿DROP PROCEDURE IF EXISTS sp_Global_CreateTanevRendje20152016
DROP PROCEDURE IF EXISTS sp_Global_CreateTanevRendje20162017
DROP PROCEDURE IF EXISTS sp_Global_CreateTanevRendje20172018
DROP PROCEDURE IF EXISTS sp_Global_CreateTanevRendje20182019
DROP PROCEDURE IF EXISTS uspCreateTanevRendje20182019
DROP PROCEDURE IF EXISTS sp_Global_IntezmenyLetrehozas
DROP PROCEDURE IF EXISTS sp_Global_GenerateTanevAdatok
GO

UPDATE T_TANEV SET 
   C_UTOLSOTANITASINAP = '20190614' 
  ,C_ELSOTANITASINAP = '20180903'
WHERE C_NEV = '2018/2019'

UPDATE T_TANEV SET 
   C_UTOLSOTANITASINAP = '20180615' 
  ,C_ELSOTANITASINAP = '20170901'
WHERE C_NEV = '2017/2018'

UPDATE T_TANEV SET 
   C_UTOLSOTANITASINAP = '20180615' 
  ,C_ELSOTANITASINAP = '20170901'
WHERE C_NEV = '2017/2018'

UPDATE T_TANEV SET 
   C_UTOLSOTANITASINAP = '20170615' 
  ,C_ELSOTANITASINAP = '20160901'
WHERE C_NEV = '2016/2017'

UPDATE T_TANEV SET 
   C_UTOLSOTANITASINAP = '20160615' 
  ,C_ELSOTANITASINAP = '20150901'
WHERE C_NEV = '2015/2016'

UPDATE T_TANEV SET 
   C_UTOLSOTANITASINAP = '20140613' 
WHERE C_NEV = '2013/2014'
GO

UPDATE T_TANEV
SET C_SORSZAM = CAST(SUBSTRING(C_NEV, 3, 2) AS int) * 2
GO

