--[T_CDA_IDENTIFIED_PATH]
if exists (select * from [AKUZ].[T_CDA_IDENTIFIED_PATH] where len([PathDescr]) > 255)
	raiserror('Уменьшить поле [PathDescr] в таблице [T_CDA_IDENTIFIED_PATH]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_IDENTIFIED_PATH] ALTER COLUMN [PathDescr] varchar(255) NULL

--CDA_INDICATION_NOSOLOGICAL_UNIT
if exists (select * from [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] where len([ClinicalDiagnosisDescription]) > 2048)
	raiserror('Уменьшить поле [ClinicalDiagnosisDescription] в таблице [T_CDA_INDICATION_NOSOLOGICAL_UNIT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] ALTER COLUMN [ClinicalDiagnosisDescription] varchar(2048) NULL

if exists (select * from [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] where len([ClarificationNature]) > 512)
	raiserror('Уменьшить поле [ClarificationNature] в таблице [T_CDA_INDICATION_NOSOLOGICAL_UNIT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] ALTER COLUMN [ClarificationNature] varchar(512) NULL

if exists (select * from [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] where len([ClarificationExternalCause]) > 512)
	raiserror('Уменьшить поле [ClarificationExternalCause] в таблице [T_CDA_INDICATION_NOSOLOGICAL_UNIT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] ALTER COLUMN [ClarificationExternalCause] varchar(512) NULL

if exists (select * from [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] where len([ClarificationTypeInjury]) > 512)
	raiserror('Уменьшить поле [ClarificationTypeInjury] в таблице [T_CDA_INDICATION_NOSOLOGICAL_UNIT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] ALTER COLUMN [ClarificationTypeInjury] varchar(512) NULL

if exists (select * from [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] where len([InformationDiagnosisFirstTime]) > 512)
	raiserror('Уменьшить поле [InformationDiagnosisFirstTime] в таблице [T_CDA_INDICATION_NOSOLOGICAL_UNIT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] ALTER COLUMN [InformationDiagnosisFirstTime] varchar(512) NULL

if exists (select * from [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] where len([AdditionalInformation]) > 512)
	raiserror('Уменьшить поле [AdditionalInformation] в таблице [T_CDA_INDICATION_NOSOLOGICAL_UNIT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] ALTER COLUMN [AdditionalInformation] varchar(512) NULL

if exists (select * from [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] where len([SubstantiationDiagnosis]) > 6000)
	raiserror('Уменьшить поле [SubstantiationDiagnosis] в таблице [T_CDA_INDICATION_NOSOLOGICAL_UNIT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INDICATION_NOSOLOGICAL_UNIT] ALTER COLUMN [SubstantiationDiagnosis] varchar(6000) NOT NULL

--T_CDA_INSTRUCTION_ADD_INFO
if exists (select * from [AKUZ].[T_CDA_INSTRUCTION_ADD_INFO] where len([Instruction]) > 512)
	raiserror('Уменьшить поле [Instruction] в таблице [T_CDA_INSTRUCTION_ADD_INFO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INSTRUCTION_ADD_INFO] ALTER COLUMN [Instruction] varchar(512) NOT NULL

-- [T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO]
if exists (select * from [AKUZ].[T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO] where len([ResultOrConclusionText]) > 1500)
	raiserror('Уменьшить поле [ResultOrConclusionText] в таблице [T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INSTRUMENTAL_RESEARCH_RESINSTR_AKENEO] ALTER COLUMN [ResultOrConclusionText] varchar(1500) NULL

--[T_CDA_LAB_GROUP_AKENEO]
if exists (select * from [AKUZ].[T_CDA_LAB_GROUP_AKENEO] where len([ResultNote]) > 512)
	raiserror('Уменьшить поле [ResultNote] в таблице [T_CDA_LAB_GROUP_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_LAB_GROUP_AKENEO] ALTER COLUMN [ResultNote] varchar(512) NULL

-- [T_CDA_LAB_RESEARCH_AKENEO]
if exists (select * from [AKUZ].[T_CDA_LAB_RESEARCH_AKENEO] where len([NoteText]) > 512)
	raiserror('Уменьшить поле [NoteText] в таблице [T_CDA_LAB_RESEARCH_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_LAB_RESEARCH_AKENEO] ALTER COLUMN [NoteText] varchar(512) NULL

-- [T_CDA_LINKDOCS_CIVIL]
if exists (select * from [AKUZ].[T_CDA_LINKDOCS_CIVIL] where len([DocumentNote]) > 512)
	raiserror('Уменьшить поле [DocumentNote] в таблице [T_CDA_LINKDOCS_CIVIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_LINKDOCS_CIVIL] ALTER COLUMN [DocumentNote] varchar(512) NULL

-- [T_CDA_MEDICAL_SERVICE_INFO]
if exists (select * from [AKUZ].[T_CDA_MEDICAL_SERVICE_INFO] where len([Comment]) > 512)
	raiserror('Уменьшить поле [Comment] в таблице [T_CDA_MEDICAL_SERVICE_INFO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_MEDICAL_SERVICE_INFO] ALTER COLUMN [Comment] varchar(512) NULL

--[T_CDA_MSE_REFERRAL]
if exists (select * from [AKUZ].[T_CDA_MSE_REFERRAL] where len([BackTalon]) > 512)
	raiserror('Уменьшить поле [BackTalon] в таблице [T_CDA_MSE_REFERRAL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_MSE_REFERRAL] ALTER COLUMN [BackTalon] varchar(512) NULL

--[T_CDA_LINKED_DOCS_IMM_INFO]
if exists (select * from [AKUZ].[T_CDA_LINKED_DOCS_IMM_INFO] where len([Note]) > 255)
	raiserror('Уменьшить поле [Note] в таблице [T_CDA_LINKED_DOCS_IMM_INFO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_LINKED_DOCS_IMM_INFO] ALTER COLUMN [Note] varchar(255) NULL

-- [T_CDA_LINKED_DOCUMENTS_INFO]
if exists (select * from [AKUZ].[T_CDA_LINKED_DOCUMENTS_INFO] where len([DocumentNote]) > 255)
	raiserror('Уменьшить поле [DocumentNote] в таблице [T_CDA_LINKED_DOCUMENTS_INFO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_LINKED_DOCUMENTS_INFO] ALTER COLUMN [DocumentNote] varchar(255) NULL

--[T_CDA_NOSOLOGICAL_UNIT]
if exists (select * from [AKUZ].[T_CDA_NOSOLOGICAL_UNIT] where len([ClinicDiagn]) > 255)
	raiserror('Уменьшить поле [ClinicDiagn] в таблице [T_CDA_NOSOLOGICAL_UNIT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_NOSOLOGICAL_UNIT] ALTER COLUMN [ClinicDiagn] varchar(255) NOT NULL

--[T_CDA_ONC_CONS_GISTRESULT_DETAIL]
if exists (select * from [AKUZ].[T_CDA_ONC_CONS_GISTRESULT_DETAIL] where len([Conclusion]) > 512)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_ONC_CONS_GISTRESULT_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONC_CONS_GISTRESULT_DETAIL] ALTER COLUMN [Conclusion] varchar(512) NULL

--[T_CDA_ONC_CONS_LINKDOCS_DETAIL]
if exists (select * from [AKUZ].[T_CDA_ONC_CONS_LINKDOCS_DETAIL] where len([Note]) > 255)
	raiserror('Уменьшить поле [Note] в таблице [T_CDA_ONC_CONS_LINKDOCS_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONC_CONS_LINKDOCS_DETAIL] ALTER COLUMN [Note] varchar(255) NULL

--[T_CDA_ONC_CONS_RESCONS_DETAIL]
if exists (select * from [AKUZ].[T_CDA_ONC_CONS_RESCONS_DETAIL] where len([Conclusion]) > 512)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_ONC_CONS_RESCONS_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONC_CONS_RESCONS_DETAIL] ALTER COLUMN [Conclusion] varchar(512) NOT NULL

-- [T_CDA_ONC_CONS_RESINSTR_DETAIL]
if exists (select * from [AKUZ].[T_CDA_ONC_CONS_RESINSTR_DETAIL] where len([Conclusion]) > 512)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_ONC_CONS_RESINSTR_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONC_CONS_RESINSTR_DETAIL] ALTER COLUMN [Conclusion] varchar(512) NOT NULL

-- [T_CDA_ONC_CONS_RESLAB_DETAIL]
if exists (select * from [AKUZ].[T_CDA_ONC_CONS_RESLAB_DETAIL] where len([Conclusion]) > 512)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_ONC_CONS_RESLAB_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONC_CONS_RESLAB_DETAIL] ALTER COLUMN [Conclusion] varchar(512) NULL

-- [T_CDA_ONC_CONS_SCORES_DETAIL]
if exists (select * from [AKUZ].[T_CDA_ONC_CONS_SCORES_DETAIL] where len([Comment]) > 255)
	raiserror('Уменьшить поле [Comment] в таблице [T_CDA_ONC_CONS_SCORES_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONC_CONS_SCORES_DETAIL] ALTER COLUMN [Comment] varchar(255) NULL

-- [T_CDA_ONC_CONS_SERVICES_DETAIL]
if exists (select * from [AKUZ].[T_CDA_ONC_CONS_SERVICES_DETAIL] where len([Comment]) > 255)
	raiserror('Уменьшить поле [Comment] в таблице [T_CDA_ONC_CONS_SERVICES_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONC_CONS_SERVICES_DETAIL] ALTER COLUMN [Comment] varchar(255) NULL

-- [T_CDA_ONC_CONS_SUM_DETAIL_COMPL]
if exists (select * from [AKUZ].[T_CDA_ONC_CONS_SUM_DETAIL_COMPL] where len([ComplicationDescription]) > 255)
	raiserror('Уменьшить поле [ComplicationDescription] в таблице [T_CDA_ONC_CONS_SUM_DETAIL_COMPL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONC_CONS_SUM_DETAIL_COMPL] ALTER COLUMN [ComplicationDescription] varchar(255) NULL

--[T_CDA_PROCEDURE_AKENEO]
if exists (select * from [AKUZ].[T_CDA_PROCEDURE_AKENEO] where len([ProcedureDescription]) > 255)
	raiserror('Уменьшить поле [ProcedureDescription] в таблице [T_CDA_PROCEDURE_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_PROCEDURE_AKENEO] ALTER COLUMN [ProcedureDescription] varchar(255) NOT NULL

--[T_CDA_OPERATION_AKENEO]
if exists (select * from [AKUZ].[T_CDA_OPERATION_AKENEO] where len([OperationDescription]) > 1000)
	raiserror('Уменьшить поле [OperationDescription] в таблице [T_CDA_OPERATION_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_OPERATION_AKENEO] ALTER COLUMN [OperationDescription] varchar(1000) NOT NULL

-- [T_CDA_PATHOLOGICAL_REACTION_AKENEO]
if exists (select * from [AKUZ].[T_CDA_PATHOLOGICAL_REACTION_AKENEO] where len([Comment]) > 512)
	raiserror('Уменьшить поле [Comment] в таблице [T_CDA_PATHOLOGICAL_REACTION_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_PATHOLOGICAL_REACTION_AKENEO] ALTER COLUMN [Comment] varchar(512) NULL

-- [T_CDA_RELATED_DOCUMENT_DETAILS]
if exists (select * from [AKUZ].[T_CDA_RELATED_DOCUMENT_DETAILS] where len([DocumentDetails]) > 255)
	raiserror('Уменьшить поле [DocumentDetails] в таблице [T_CDA_RELATED_DOCUMENT_DETAILS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_RELATED_DOCUMENT_DETAILS] ALTER COLUMN [DocumentDetails] varchar(255) NULL

-- [T_CDA_RESLAB_GROUP_ELEMENT_V4]
if exists (select * from [AKUZ].[T_CDA_RESLAB_GROUP_ELEMENT_V4] where len([ResearchComment]) > 255)
	raiserror('Уменьшить поле [ResearchComment] в таблице [T_CDA_RESLAB_GROUP_ELEMENT_V4]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_RESLAB_GROUP_ELEMENT_V4] ALTER COLUMN [ResearchComment] varchar(255) NULL

-- [T_CDA_RESLAB_REPORT_FOR_ELMK]
if exists (select * from [AKUZ].[T_CDA_RESLAB_REPORT_FOR_ELMK] where len([Note]) > 255)
	raiserror('Уменьшить поле [Note] в таблице [T_CDA_RESLAB_REPORT_FOR_ELMK]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_RESLAB_REPORT_FOR_ELMK] ALTER COLUMN [Note] varchar(255) NULL

--[T_CDA_RESULTS_RESEARCH]
if exists (select * from [AKUZ].[T_CDA_RESULTS_RESEARCH] where len([Conclusion]) > 512)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_RESULTS_RESEARCH]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_RESULTS_RESEARCH] ALTER COLUMN [Conclusion] varchar(512) NOT NULL

-- [T_CDA_SECTION_BLOOD_DONATION_LINKDOCS_DETAIL]
if exists (select * from [AKUZ].[T_CDA_SECTION_BLOOD_DONATION_LINKDOCS_DETAIL] where len([Note]) > 255)
	raiserror('Уменьшить поле [Note] в таблице [T_CDA_SECTION_BLOOD_DONATION_LINKDOCS_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_BLOOD_DONATION_LINKDOCS_DETAIL] ALTER COLUMN [Note] varchar(255) NULL

-- [T_CDA_SECTION_BLOOD_SYSTEM]
if exists (select * from [AKUZ].[T_CDA_SECTION_BLOOD_SYSTEM] where len([BloodSystem]) > 512)
	raiserror('Уменьшить поле [BloodSystem] в таблице [T_CDA_SECTION_BLOOD_SYSTEM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_BLOOD_SYSTEM] ALTER COLUMN [BloodSystem] varchar(512) NOT NULL

-- [T_CDA_SECTION_DIGESTIVE_SYSTEM]
if exists (select * from [AKUZ].[T_CDA_SECTION_DIGESTIVE_SYSTEM] where len([DigestiveSystem]) > 512)
	raiserror('Уменьшить поле [DigestiveSystem] в таблице [T_CDA_SECTION_DIGESTIVE_SYSTEM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_DIGESTIVE_SYSTEM] ALTER COLUMN [DigestiveSystem] varchar(512) NOT NULL

-- [T_CDA_SECTION_DOCINFO_PROTOCOLV2]
if exists (select * from [AKUZ].[T_CDA_SECTION_DOCINFO_PROTOCOLV2] where len([InformDecision]) > 1024)
	raiserror('Уменьшить поле [InformDecision] в таблице [T_CDA_SECTION_DOCINFO_PROTOCOLV2]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_DOCINFO_PROTOCOLV2] ALTER COLUMN [InformDecision] varchar(1024) NOT NULL

if exists (select * from [AKUZ].[T_CDA_SECTION_DOCINFO_PROTOCOLV2] where len([DecisionText]) > 1024)
	raiserror('Уменьшить поле [DecisionText] в таблице [T_CDA_SECTION_DOCINFO_PROTOCOLV2]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_DOCINFO_PROTOCOLV2] ALTER COLUMN [DecisionText] varchar(1024) NOT NULL

-- [T_CDA_SECTION_DRIVER_RESEARCH_RESLAB_DETAIL]
if exists (select * from [AKUZ].[T_CDA_SECTION_DRIVER_RESEARCH_RESLAB_DETAIL] where len([LabResearch]) > 255)
	raiserror('Уменьшить поле [LabResearch] в таблице [T_CDA_SECTION_DRIVER_RESEARCH_RESLAB_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_DRIVER_RESEARCH_RESLAB_DETAIL] ALTER COLUMN [LabResearch] varchar(255) NULL

-- [T_CDA_SECTION_ELDERLY_DOCINFO]
if exists (select * from [AKUZ].[T_CDA_SECTION_ELDERLY_DOCINFO] where len([MedicalContraindications]) > 512)
	raiserror('Уменьшить поле [MedicalContraindications] в таблице [T_CDA_SECTION_ELDERLY_DOCINFO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_ELDERLY_DOCINFO] ALTER COLUMN [MedicalContraindications] varchar(512) NULL

if exists (select * from [AKUZ].[T_CDA_SECTION_ELDERLY_DOCINFO] where len([Comment]) > 512)
	raiserror('Уменьшить поле [Comment] в таблице [T_CDA_SECTION_ELDERLY_DOCINFO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_ELDERLY_DOCINFO] ALTER COLUMN [Comment] varchar(512) NULL

-- [T_CDA_SECTION_KID_SANATORY_CARD_RECTREAT]
if exists (select * from [AKUZ].[T_CDA_SECTION_KID_SANATORY_CARD_RECTREAT] where len([Recommendation]) > 512)
	raiserror('Уменьшить поле [Recommendation] в таблице [T_CDA_SECTION_KID_SANATORY_CARD_RECTREAT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_KID_SANATORY_CARD_RECTREAT] ALTER COLUMN [Recommendation] varchar(512) NOT NULL

-- [T_CDA_SECTION_KID_SANATORY_CARD_SUM]
if exists (select * from [AKUZ].[T_CDA_SECTION_KID_SANATORY_CARD_SUM] where len([PerformedTreatment]) > 512)
	raiserror('Уменьшить поле [PerformedTreatment] в таблице [T_CDA_SECTION_KID_SANATORY_CARD_SUM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_KID_SANATORY_CARD_SUM] ALTER COLUMN [PerformedTreatment] varchar(512) NOT NULL

if exists (select * from [AKUZ].[T_CDA_SECTION_KID_SANATORY_CARD_SUM] where len([Epicrisis]) > 512)
	raiserror('Уменьшить поле [Epicrisis] в таблице [T_CDA_SECTION_KID_SANATORY_CARD_SUM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_KID_SANATORY_CARD_SUM] ALTER COLUMN [Epicrisis] varchar(512) NOT NULL

-- [T_CDA_SECTION_LABORATORY_RESULT]
if exists (select * from [AKUZ].[T_CDA_SECTION_LABORATORY_RESULT] where len([Summary]) > 255)
	raiserror('Уменьшить поле [Summary] в таблице [T_CDA_SECTION_LABORATORY_RESULT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_LABORATORY_RESULT] ALTER COLUMN [Summary] varchar(255) NULL

-- [T_CDA_SECTION_LABORATORY_RESULTS]
if exists (select * from [AKUZ].[T_CDA_SECTION_LABORATORY_RESULTS] where len([Result]) > 4000)
	raiserror('Уменьшить поле [Result] в таблице [T_CDA_SECTION_LABORATORY_RESULTS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_LABORATORY_RESULTS] ALTER COLUMN [Result] varchar(4000) NULL

-- [T_CDA_SECTION_LINKDOCS_CHILD]
if exists (select * from [AKUZ].[T_CDA_SECTION_LINKDOCS_CHILD] where len([DocumentText]) > 255)
	raiserror('Уменьшить поле [DocumentText] в таблице [T_CDA_SECTION_LINKDOCS_CHILD]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_LINKDOCS_CHILD] ALTER COLUMN [DocumentText] varchar(255) NULL

-- [T_CDA_SECTION_LINKDOCS_ELDERLY]
if exists (select * from [AKUZ].[T_CDA_SECTION_LINKDOCS_ELDERLY] where len([DocumentText]) > 255)
	raiserror('Уменьшить поле [DocumentText] в таблице [T_CDA_SECTION_LINKDOCS_ELDERLY]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_LINKDOCS_ELDERLY] ALTER COLUMN [DocumentText] varchar(255) NULL

-- [T_CDA_SECTION_LOCAL_STATUS]
if exists (select * from [AKUZ].[T_CDA_SECTION_LOCAL_STATUS] where len([LocalStatus]) > 6000)
	raiserror('Уменьшить поле [LocalStatus] в таблице [T_CDA_SECTION_LOCAL_STATUS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_LOCAL_STATUS] ALTER COLUMN [LocalStatus] varchar(6000) NOT NULL

-- [T_CDA_SECTION_MEDICAL_INTERVENTIONS]
if exists (select * from [AKUZ].[T_CDA_SECTION_MEDICAL_INTERVENTIONS] where len([MedicalInterventions]) > 255)
	raiserror('Уменьшить поле [MedicalInterventions] в таблице [T_CDA_SECTION_MEDICAL_INTERVENTIONS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_MEDICAL_INTERVENTIONS] ALTER COLUMN [MedicalInterventions] varchar(255) NOT NULL

-- [T_CDA_SECTION_GENITOURINARY_SYSTEM]
if exists (select * from [AKUZ].[T_CDA_SECTION_GENITOURINARY_SYSTEM] where len([GenitourinarySystem]) > 255)
	raiserror('Уменьшить поле [GenitourinarySystem] в таблице [T_CDA_SECTION_GENITOURINARY_SYSTEM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_GENITOURINARY_SYSTEM] ALTER COLUMN [GenitourinarySystem] varchar(255) NOT NULL

-- [T_CDA_SECTION_NONDRUG_TREATMENT]
if exists (select * from [AKUZ].[T_CDA_SECTION_NONDRUG_TREATMENT] where len([NonDrugTreatment]) > 2500)
	raiserror('Уменьшить поле [NonDrugTreatment] в таблице [T_CDA_SECTION_NONDRUG_TREATMENT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_NONDRUG_TREATMENT] ALTER COLUMN [NonDrugTreatment] varchar(2500) NOT NULL

-- [T_CDA_SECTION_ONC_CONS_ANAM]
if exists (select * from [AKUZ].[T_CDA_SECTION_ONC_CONS_ANAM] where len([CourseOfDisease]) > 512)
	raiserror('Уменьшить поле [CourseOfDisease] в таблице [T_CDA_SECTION_ONC_CONS_ANAM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_ONC_CONS_ANAM] ALTER COLUMN [CourseOfDisease] varchar(512) NOT NULL

-- [T_CDA_SECTION_ONC_CONS_CONSILIUM]
if exists (select * from [AKUZ].[T_CDA_SECTION_ONC_CONS_CONSILIUM] where len([Decision]) > 512)
	raiserror('Уменьшить поле [Decision] в таблице [T_CDA_SECTION_ONC_CONS_CONSILIUM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_ONC_CONS_CONSILIUM] ALTER COLUMN [Decision] varchar(512) NOT NULL

-- [T_CDA_SECTION_ONC_CONS_PATOBJ]
if exists (select * from [AKUZ].[T_CDA_SECTION_ONC_CONS_PATOBJ] where len([PatientCondition]) > 1024)
	raiserror('Уменьшить поле [PatientCondition] в таблице [T_CDA_SECTION_ONC_CONS_PATOBJ]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_ONC_CONS_PATOBJ] ALTER COLUMN [PatientCondition] varchar(1024) NOT NULL

-- [T_CDA_SECTION_ONC_CONS_RECEXAM]
if exists (select * from [AKUZ].[T_CDA_SECTION_ONC_CONS_RECEXAM] where len([Recommendation]) > 255)
	raiserror('Уменьшить поле [Recommendation] в таблице [T_CDA_SECTION_ONC_CONS_RECEXAM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_ONC_CONS_RECEXAM] ALTER COLUMN [Recommendation] varchar(255) NOT NULL

-- [T_CDA_SECTION_ONC_CONS_RECOTHER]
if exists (select * from [AKUZ].[T_CDA_SECTION_ONC_CONS_RECOTHER] where len([OtherRecommendations]) > 512)
	raiserror('Уменьшить поле [OtherRecommendations] в таблице [T_CDA_SECTION_ONC_CONS_RECOTHER]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_ONC_CONS_RECOTHER] ALTER COLUMN [OtherRecommendations] varchar(512) NOT NULL

-- [T_CDA_SECTION_PLANSUR]
if exists (select * from [AKUZ].[T_CDA_SECTION_PLANSUR] where len([PreoperativeEpicrisis]) > 512)
	raiserror('Уменьшить поле [PreoperativeEpicrisis] в таблице [T_CDA_SECTION_PLANSUR]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_PLANSUR] ALTER COLUMN [PreoperativeEpicrisis] varchar(512) NULL

if exists (select * from [AKUZ].[T_CDA_SECTION_PLANSUR] where len([OperationJustification]) > 512)
	raiserror('Уменьшить поле [OperationJustification] в таблице [T_CDA_SECTION_PLANSUR]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_PLANSUR] ALTER COLUMN [OperationJustification] varchar(512) NULL

if exists (select * from [AKUZ].[T_CDA_SECTION_PLANSUR] where len([OperationPlan]) > 512)
	raiserror('Уменьшить поле [OperationPlan] в таблице [T_CDA_SECTION_PLANSUR]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_PLANSUR] ALTER COLUMN [OperationPlan] varchar(512) NULL

if exists (select * from [AKUZ].[T_CDA_SECTION_PLANSUR] where len([Premedication]) > 512)
	raiserror('Уменьшить поле [Premedication] в таблице [T_CDA_SECTION_PLANSUR]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_PLANSUR] ALTER COLUMN [Premedication] varchar(512) NULL

-- [T_CDA_SECTION_MENTAL_STATUS]
if exists (select * from [AKUZ].[T_CDA_SECTION_MENTAL_STATUS] where len([MentalStatus]) > 3000)
	raiserror('Уменьшить поле [MentalStatus] в таблице [T_CDA_SECTION_MENTAL_STATUS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_MENTAL_STATUS] ALTER COLUMN [MentalStatus] varchar(3000) NOT NULL

-- [T_CDA_SECTION_MUSCULOSKELETAL_SYSTEM]
if exists (select * from [AKUZ].[T_CDA_SECTION_MUSCULOSKELETAL_SYSTEM] where len([MusculoskeletalSystem]) > 512)
	raiserror('Уменьшить поле [MusculoskeletalSystem] в таблице [T_CDA_SECTION_MUSCULOSKELETAL_SYSTEM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_MUSCULOSKELETAL_SYSTEM] ALTER COLUMN [MusculoskeletalSystem] varchar(512) NOT NULL

-- [T_CDA_SECTION_NERVOUS_SYSTEM]
if exists (select * from [AKUZ].[T_CDA_SECTION_NERVOUS_SYSTEM] where len([NervousSystem]) > 512)
	raiserror('Уменьшить поле [NervousSystem] в таблице [T_CDA_SECTION_NERVOUS_SYSTEM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_NERVOUS_SYSTEM] ALTER COLUMN [NervousSystem] varchar(512) NOT NULL

-- [T_CDA_SECTION_NONDRUG]
if exists (select * from [AKUZ].[T_CDA_SECTION_NONDRUG] where len([MedicalProcedureDescription]) > 255)
	raiserror('Уменьшить поле [MedicalProcedureDescription] в таблице [T_CDA_SECTION_NONDRUG]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_NONDRUG] ALTER COLUMN [MedicalProcedureDescription] varchar(255) NOT NULL

-- [T_CDA_SECTION_REGIME_DSIPANDPMO]
if exists (select * from [AKUZ].[T_CDA_SECTION_REGIME_DSIPANDPMO] where len([Recomendations]) > 255)
	raiserror('Уменьшить поле [Recomendations] в таблице [T_CDA_SECTION_REGIME_DSIPANDPMO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_REGIME_DSIPANDPMO] ALTER COLUMN [Recomendations] varchar(255) NULL

-- [T_CDA_SECTION_REGIME_NEWBORN]
if exists (select * from [AKUZ].[T_CDA_SECTION_REGIME_NEWBORN] where len([RecommendedTreatment]) > 512)
	raiserror('Уменьшить поле [RecommendedTreatment] в таблице [T_CDA_SECTION_REGIME_NEWBORN]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_REGIME_NEWBORN] ALTER COLUMN [RecommendedTreatment] varchar(512) NULL

-- [T_CDA_SECTION_RESINFO_AKENEO]
if exists (select * from [AKUZ].[T_CDA_SECTION_RESINFO_AKENEO] where len([Protocol]) > 1024)
	raiserror('Уменьшить поле [Protocol] в таблице [T_CDA_SECTION_RESINFO_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_RESINFO_AKENEO] ALTER COLUMN [Protocol] varchar(1024) NOT NULL

if exists (select * from [AKUZ].[T_CDA_SECTION_RESINFO_AKENEO] where len([Conclusion]) > 512)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_SECTION_RESINFO_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_RESINFO_AKENEO] ALTER COLUMN [Conclusion] varchar(512) NOT NULL

if exists (select * from [AKUZ].[T_CDA_SECTION_RESINFO_AKENEO] where len([Recomendations]) > 512)
	raiserror('Уменьшить поле [Recomendations] в таблице [T_CDA_SECTION_RESINFO_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_RESINFO_AKENEO] ALTER COLUMN [Recomendations] varchar(512) NULL

-- [T_CDA_SECTION_RESINSTR_REPORT_FOR_ELMK]
if exists (select * from [AKUZ].[T_CDA_SECTION_RESINSTR_REPORT_FOR_ELMK] where len([Note]) > 255)
	raiserror('Уменьшить поле [Note] в таблице [T_CDA_SECTION_RESINSTR_REPORT_FOR_ELMK]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_RESINSTR_REPORT_FOR_ELMK] ALTER COLUMN [Note] varchar(255) NULL

-- [T_CDA_SECTION_RESLAB_AKENEO]
if exists (select * from [AKUZ].[T_CDA_SECTION_RESLAB_AKENEO] where len([Conclusion]) > 255)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_SECTION_RESLAB_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_RESLAB_AKENEO] ALTER COLUMN [Conclusion] varchar(255) NULL

-- [T_CDA_SECTION_RESPIRATORY_SYSTEM]
if exists (select * from [AKUZ].[T_CDA_SECTION_RESPIRATORY_SYSTEM] where len([RespiratorySystem]) > 512)
	raiserror('Уменьшить поле [RespiratorySystem] в таблице [T_CDA_SECTION_RESPIRATORY_SYSTEM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_RESPIRATORY_SYSTEM] ALTER COLUMN [RespiratorySystem] varchar(512) NOT NULL

-- [T_CDA_SECTION_SKIN]
if exists (select * from [AKUZ].[T_CDA_SECTION_SKIN] where len([Skin]) > 512)
	raiserror('Уменьшить поле [Skin] в таблице [T_CDA_SECTION_SKIN]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_SKIN] ALTER COLUMN [Skin] varchar(512) NOT NULL

-- [T_CDA_SECTION_STAGE_EPICRISIS]
if exists (select * from [AKUZ].[T_CDA_SECTION_STAGE_EPICRISIS] where len([StageEpicrisis]) > 2500)
	raiserror('Уменьшить поле [StageEpicrisis] в таблице [T_CDA_SECTION_STAGE_EPICRISIS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_STAGE_EPICRISIS] ALTER COLUMN [StageEpicrisis] varchar(2500) NOT NULL

if exists (select * from [AKUZ].[T_CDA_SECTION_STAGE_EPICRISIS] where len([DocumentNote]) > 255)
	raiserror('Уменьшить поле [DocumentNote] в таблице [T_CDA_SECTION_STAGE_EPICRISIS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_STAGE_EPICRISIS] ALTER COLUMN [DocumentNote] varchar(255) NULL

-- [T_CDA_SECTION_SURVEY]
if exists (select * from [AKUZ].[T_CDA_SECTION_SURVEY] where len([SurveyPlan]) > 2500)
	raiserror('Уменьшить поле [SurveyPlan] в таблице [T_CDA_SECTION_SURVEY]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_SURVEY] ALTER COLUMN [SurveyPlan] varchar(2500) NOT NULL

-- [T_CDA_SECTION_TREATMENT_PLAN]
if exists (select * from [AKUZ].[T_CDA_SECTION_TREATMENT_PLAN] where len([TreatmentPlan]) > 7000)
	raiserror('Уменьшить поле [TreatmentPlan] в таблице [T_CDA_SECTION_TREATMENT_PLAN]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SECTION_TREATMENT_PLAN] ALTER COLUMN [TreatmentPlan] varchar(7000) NOT NULL

-- [T_CDA_SPECIAL_INSTRUCT]
if exists (select * from [AKUZ].[T_CDA_SPECIAL_INSTRUCT] where len([SpecialInstrText]) > 255)
	raiserror('Уменьшить поле [SpecialInstrText] в таблице [T_CDA_SPECIAL_INSTRUCT]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SPECIAL_INSTRUCT] ALTER COLUMN [SpecialInstrText] varchar(255) NOT NULL

-- [T_CDA_SPECIAL_INSTRUCTIONS_DRUG]
if exists (select * from [AKUZ].[T_CDA_SPECIAL_INSTRUCTIONS_DRUG] where len([SpecialInstructions]) > 255)
	raiserror('Уменьшить поле [SpecialInstructions] в таблице [T_CDA_SPECIAL_INSTRUCTIONS_DRUG]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SPECIAL_INSTRUCTIONS_DRUG] ALTER COLUMN [SpecialInstructions] varchar(255) NOT NULL

-- [T_CDA_SUR_DGN]
if exists (select * from [AKUZ].[T_CDA_SUR_DGN] where len([ONMKDescription]) > 255)
	raiserror('Уменьшить поле [ONMKDescription] в таблице [T_CDA_SUR_DGN]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SUR_DGN] ALTER COLUMN [ONMKDescription] varchar(255) NULL

if exists (select * from [AKUZ].[T_CDA_SUR_DGN] where len([ONMKPeriod]) > 255)
	raiserror('Уменьшить поле [ONMKPeriod] в таблице [T_CDA_SUR_DGN]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SUR_DGN] ALTER COLUMN [ONMKPeriod] varchar(255) NULL

if exists (select * from [AKUZ].[T_CDA_SUR_DGN] where len([ONMKReasons]) > 255)
	raiserror('Уменьшить поле [ONMKReasons] в таблице [T_CDA_SUR_DGN]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SUR_DGN] ALTER COLUMN [ONMKReasons] varchar(255) NULL

if exists (select * from [AKUZ].[T_CDA_SUR_DGN] where len([ONMKTreatment]) > 255)
	raiserror('Уменьшить поле [ONMKTreatment] в таблице [T_CDA_SUR_DGN]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SUR_DGN] ALTER COLUMN [ONMKTreatment] varchar(255) NULL

-- [T_CDA_SUR_DGN_OKS_TREATMENT_LINK]
if exists (select * from [AKUZ].[T_CDA_SUR_DGN_OKS_TREATMENT_LINK] where len([TreatmentDescription]) > 512)
	raiserror('Уменьшить поле [TextDescSurgical] в таблице [T_CDA_SUR_DGN_OKS_TREATMENT_LINK]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SUR_DGN_OKS_TREATMENT_LINK] ALTER COLUMN [TreatmentDescription] varchar(512) NOT NULL

-- [T_CDA_SURG_INTERVENTION_LINKDOCS_DETAIL]
if exists (select * from [AKUZ].[T_CDA_SURG_INTERVENTION_LINKDOCS_DETAIL] where len([DocNote]) > 255)
	raiserror('Уменьшить поле [DocNote] в таблице [T_CDA_SURG_INTERVENTION_LINKDOCS_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SURG_INTERVENTION_LINKDOCS_DETAIL] ALTER COLUMN [DocNote] varchar(255) NULL

-- [T_CDA_SURG_INTERVENTION_SERVICES_DETAIL]
if exists (select * from [AKUZ].[T_CDA_SURG_INTERVENTION_SERVICES_DETAIL] where len([Comment]) > 255)
	raiserror('Уменьшить поле [Comment] в таблице [T_CDA_SURG_INTERVENTION_SERVICES_DETAIL]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SURG_INTERVENTION_SERVICES_DETAIL] ALTER COLUMN [Comment] varchar(255) NULL

-- [T_CDA_SURGICAL_INTERVENTIONS]
if exists (select * from [AKUZ].[T_CDA_SURGICAL_INTERVENTIONS] where len([TextDescSurgical]) > 512)
	raiserror('Уменьшить поле [TextDescSurgical] в таблице [T_CDA_SURGICAL_INTERVENTIONS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_SURGICAL_INTERVENTIONS] ALTER COLUMN [TextDescSurgical] varchar(512) NOT NULL

-- [T_CDA_VETERAN_LINKDOCS]
if exists (select * from [AKUZ].[T_CDA_VETERAN_LINKDOCS] where len([DocumentNote]) > 255)
	raiserror('Уменьшить поле [DocumentNote] в таблице [T_CDA_VETERAN_LINKDOCS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_VETERAN_LINKDOCS] ALTER COLUMN [DocumentNote] varchar(255) NULL

-- [T_CDA_VIMIS_PLANNED_LAB_STUDY]
if exists (select * from [AKUZ].[T_CDA_VIMIS_PLANNED_LAB_STUDY] where len([MethodStudyDesc]) > 255)
	raiserror('Уменьшить поле [MethodStudyDesc] в таблице [T_CDA_VIMIS_PLANNED_LAB_STUDY]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_VIMIS_PLANNED_LAB_STUDY] ALTER COLUMN [MethodStudyDesc] varchar(255) NULL

-- [T_CDA_VITA_PARAMETER]
if exists (select * from [AKUZ].[T_CDA_VITA_PARAMETER] where len([RefIntervalDescr]) > 255)
	raiserror('Уменьшить поле [RefIntervalDescr] в таблице [T_CDA_VITA_PARAMETER]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_VITA_PARAMETER] ALTER COLUMN [RefIntervalDescr] varchar(255) NULL

-- [T_CDA_VITAL_PARAMETER_INFO]
if exists (select * from [AKUZ].[T_CDA_VITAL_PARAMETER_INFO] where len([Comment]) > 255)
	raiserror('Уменьшить поле [Comment] в таблице [T_CDA_VITAL_PARAMETER_INFO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_VITAL_PARAMETER_INFO] ALTER COLUMN [Comment] varchar(255) NULL

-- [T_CDA_VITALS]
if exists (select * from [AKUZ].[T_CDA_VITALS] where len([Comment]) > 255)
	raiserror('Уменьшить поле [Comment] в таблице [T_CDA_VITALS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_VITALS] ALTER COLUMN [Comment] varchar(255) NULL

-- [T_CDA_ANAMNESIS_LIFE]
if exists (select * from [AKUZ].[T_CDA_ANAMNESIS_LIFE] where len([AnamnesisLifeText]) > 1024)
	raiserror('Уменьшить поле [AnamnesisLifeText] в таблице [T_CDA_ANAMNESIS_LIFE]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ANAMNESIS_LIFE] ALTER COLUMN [AnamnesisLifeText] varchar(1024) NOT NULL

-- [T_CDA_CONS_RESULT_AKENEO]
if exists (select * from [AKUZ].[T_CDA_CONS_RESULT_AKENEO] where len([ResultsOrConclusion]) > 1024)
	raiserror('Уменьшить поле [ResultsOrConclusion] в таблице [T_CDA_CONS_RESULT_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_CONS_RESULT_AKENEO] ALTER COLUMN [ResultsOrConclusion] varchar(1024) NULL

if exists (select * from [AKUZ].[T_CDA_CONS_RESULT_AKENEO] where len([Protocol]) > 1024)
	raiserror('Уменьшить поле [Protocol] в таблице [T_CDA_CONS_RESULT_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_CONS_RESULT_AKENEO] ALTER COLUMN [Protocol] varchar(1024) NOT NULL

if exists (select * from [AKUZ].[T_CDA_CONS_RESULT_AKENEO] where len([Conclusion]) > 1024)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_CONS_RESULT_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_CONS_RESULT_AKENEO] ALTER COLUMN [Conclusion] varchar(1024) NOT NULL

-- [T_CDA_CONSULTATION_KAS_AKENEO]
if exists (select * from [AKUZ].[T_CDA_CONSULTATION_KAS_AKENEO] where len([Objectively]) > 255)
	raiserror('Уменьшить поле [Objectively] в таблице [T_CDA_CONSULTATION_KAS_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_CONSULTATION_KAS_AKENEO] ALTER COLUMN [Objectively] varchar(255) NULL

if exists (select * from [AKUZ].[T_CDA_CONSULTATION_KAS_AKENEO] where len([Conclusion]) > 512)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_CONSULTATION_KAS_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_CONSULTATION_KAS_AKENEO] ALTER COLUMN [Conclusion] varchar(512) NOT NULL

if exists (select * from [AKUZ].[T_CDA_CONSULTATION_KAS_AKENEO] where len([Recommendations]) > 512)
	raiserror('Уменьшить поле [Recommendations] в таблице [T_CDA_CONSULTATION_KAS_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_CONSULTATION_KAS_AKENEO] ALTER COLUMN [Recommendations] varchar(512) NULL

-- [T_CDA_CYTOLOGICAL_PARAMETER_CYT_EXAM]
if exists (select * from [AKUZ].[T_CDA_CYTOLOGICAL_PARAMETER_CYT_EXAM] where len([Result]) > 1024)
	raiserror('Уменьшить поле [Result] в таблице [T_CDA_CYTOLOGICAL_PARAMETER_CYT_EXAM]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_CYTOLOGICAL_PARAMETER_CYT_EXAM] ALTER COLUMN [Result] varchar(1024) NULL

-- [T_CDA_DIAGNOSIS_V2]
if exists (select * from [AKUZ].[T_CDA_DIAGNOSIS_V2] where len([NosologicalDescr]) > 255)
	raiserror('Уменьшить поле [NosologicalDescr] в таблице [T_CDA_DIAGNOSIS_V2]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_DIAGNOSIS_V2] ALTER COLUMN [NosologicalDescr] varchar(255) NULL

-- [T_CDA_EXAMINATION_SPECIALIST]
if exists (select * from [AKUZ].[T_CDA_EXAMINATION_SPECIALIST] where len([PatientComplaintsText]) > 512)
	raiserror('Уменьшить поле [PatientComplaintsText] в таблице [T_CDA_EXAMINATION_SPECIALIST]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_EXAMINATION_SPECIALIST] ALTER COLUMN [PatientComplaintsText] varchar(512) NOT NULL

if exists (select * from [AKUZ].[T_CDA_EXAMINATION_SPECIALIST] where len([ObjStatusText]) > 512)
	raiserror('Уменьшить поле [ObjStatusText] в таблице [T_CDA_EXAMINATION_SPECIALIST]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_EXAMINATION_SPECIALIST] ALTER COLUMN [ObjStatusText] varchar(512) NOT NULL

-- [T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO]
if exists (select * from [AKUZ].[T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO] where len([Protocol]) > 255)
	raiserror('Уменьшить поле [Protocol] в таблице [T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO] ALTER COLUMN [Protocol] varchar(255) NULL

if exists (select * from [AKUZ].[T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO] where len([Conclusion]) > 255)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_INSTRUMENTAL_RESEARCH_KAS_AKENEO] ALTER COLUMN [Conclusion] varchar(255) NOT NULL

-- [T_CDA_FINAL_DGN_CONCOMITANT_PATHOLOGY_AKENEO]
if exists (select * from [AKUZ].[T_CDA_FINAL_DGN_CONCOMITANT_PATHOLOGY_AKENEO] where len([DoctorDesc]) > 255)
	raiserror('Уменьшить поле [DoctorDesc] в таблице [T_CDA_FINAL_DGN_CONCOMITANT_PATHOLOGY_AKENEO]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_FINAL_DGN_CONCOMITANT_PATHOLOGY_AKENEO] ALTER COLUMN [DoctorDesc] varchar(255) NULL

--[T_CDA_MATERIAL_SAMPLE]
if exists (select * from [AKUZ].[T_CDA_MATERIAL_SAMPLE] where len([SamplelDesc]) > 512)
	raiserror('Уменьшить поле [SamplelDesc] в таблице [T_CDA_MATERIAL_SAMPLE]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_MATERIAL_SAMPLE] ALTER COLUMN [SamplelDesc] varchar(512) NOT NULL

-- [T_CDA_ONKO_PROC_RESCONS]
if exists (select * from [AKUZ].[T_CDA_ONKO_PROC_RESCONS] where len([Results]) > 255)
	raiserror('Уменьшить поле [Results] в таблице [T_CDA_ONKO_PROC_RESCONS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONKO_PROC_RESCONS] ALTER COLUMN [Results] varchar(255) NULL

if exists (select * from [AKUZ].[T_CDA_ONKO_PROC_RESCONS] where len([Conclusion]) > 7500)
	raiserror('Уменьшить поле [Conclusion] в таблице [T_CDA_ONKO_PROC_RESCONS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONKO_PROC_RESCONS] ALTER COLUMN [Conclusion] varchar(7500) NOT NULL

if exists (select * from [AKUZ].[T_CDA_ONKO_PROC_RESCONS] where len([Recomendations]) > 1024)
	raiserror('Уменьшить поле [Recomendations] в таблице [T_CDA_ONKO_PROC_RESCONS]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONKO_PROC_RESCONS] ALTER COLUMN [Recomendations] varchar(1024) NULL

-- [T_CDA_ONKO_PROC_RESLAB]
if exists (select * from [AKUZ].[T_CDA_ONKO_PROC_RESLAB] where len([DiagnosticsResultDescription]) > 7500)
	raiserror('Уменьшить поле [DiagnosticsResultDescription] в таблице [T_CDA_ONKO_PROC_RESLAB]', 16, 10);
ALTER TABLE [AKUZ].[T_CDA_ONKO_PROC_RESLAB] ALTER COLUMN [DiagnosticsResultDescription] varchar(7500) NULL

