ALTER TABLE [AKUZ].[T_FRMR_address] ADD [FrmrPersonAddress] uniqueidentifier NULL
GO

UPDATE a
SET a.[FrmrPersonAddress] = pa.[FrmrPersonAddressID]
from [AKUZ].[T_FRMR_address] a JOIN [AKUZ].[T_FRMR_person_address] pa on a.[FrmrAddressID] = pa.[FrmrAddress]

DELETE a FROM [AKUZ].[T_FRMR_address] a WHERE a.[FrmrPersonAddress] is null

ALTER TABLE [AKUZ].[T_FRMR_address] ADD CONSTRAINT [FK_T_FRMR_PERSON_ADDRESS_T_FRMR_ADDRESS_FrmrPersonAddress]
FOREIGN KEY([FrmrPersonAddress]) REFERENCES [AKUZ].[T_FRMR_person_address] ([FrmrPersonAddressID])
GO

ALTER TABLE [AKUZ].[ALTER] ALTER COLUMN [FrmrPersonAddress] uniqueidentifier NOT NULL
GO

ALTER TABLE [AKUZ].[T_FRMR_person_address] DROP CONSTRAINT [FK_T_FRMR_ADDRESS_T_FRMR_PERSON_ADDRESS_FrmrAddress]
GO

ALTER TABLE [AKUZ].[T_FRMR_person_address] DROP COLUMN [FrmrAddress]
GO