-- Tables

-- Alters

ALTER TABLE [AKUZ].[T_ONK_CYTOLOGY_RESULT_BASE] ADD [PathologistPost] int NULL
GO

update cb
    set cb.[PathologistPost] = mr.Post
from [AKUZ].[T_ONK_CYTOLOGY_RESULT_BASE] cb
    join [AKUZ].T_MEDICAL_RECORD mr on mr.MedicalRecordID = cb.MedicalRecordID


ALTER TABLE [AKUZ].[T_ONK_CYTOLOGY_RESULT_BASE] ADD CONSTRAINT [FK_T_POST_T_ONK_CYTOLOGY_RESULT_BASE_PathologistPost]
FOREIGN KEY([PathologistPost]) REFERENCES [AKUZ].[T_POST] ([ResourceID])
GO

