ALTER TABLE [dbo].[T_EXTRA_TEMPLATE] ADD [ReportFileParameters] text
GO



ALTER TABLE [dbo].[T_EXTRA_TEMPLATE] ADD [OutputName] varchar(255)
GO
update et
set et.OutputName = euc.OutputName
from T_EXTRA_TEMPLATE et
    join T_EXTRA_UI_COMMAND euc on euc.ExtraUiCommandID = et.ExtraUiCommand
GO
ALTER TABLE [dbo].[T_EXTRA_UI_COMMAND] DROP COLUMN [OutputName]
GO



ALTER TABLE [dbo].[T_EXTRA_TEMPLATE] ADD [ReportProcessingWay] int
GO
update et
set et.ReportProcessingWay = euc.ReportProcessingWay
from T_EXTRA_TEMPLATE et
    join T_EXTRA_UI_COMMAND euc on euc.ExtraUiCommandID = et.ExtraUiCommand
GO
update et
set et.ReportProcessingWay = 0
from T_EXTRA_TEMPLATE et
where ReportProcessingWay is null
GO
ALTER TABLE [dbo].[T_EXTRA_TEMPLATE] ALTER COLUMN [ReportProcessingWay] int NOT NULL
GO
ALTER TABLE [dbo].[T_EXTRA_UI_COMMAND] DROP COLUMN [ReportProcessingWay]
GO



ALTER TABLE [dbo].[T_EXTRA_TEMPLATE] ADD [OutputFormat] int
GO
update et
set et.OutputFormat = euc.OutputFormat
from T_EXTRA_TEMPLATE et
    join T_EXTRA_UI_COMMAND euc on euc.ExtraUiCommandID = et.ExtraUiCommand
GO
ALTER TABLE [dbo].[T_EXTRA_UI_COMMAND] DROP COLUMN [OutputFormat]
GO