
[dbo].[BcCustomerAddress]
CREATE TABLE [dbo].[BcCustomerAddress]
(
[BcCustomerAddressId] [int] NOT NULL IDENTITY(1, 1),
[BcId] [uniqueidentifier] NOT NULL,
[AccountingCustomerAddressFid] [int] NOT NULL,
[CreatedOn] [datetimeoffset] NOT NULL,
[LastImportedOn] [datetimeoffset] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BcCustomerAddress] ADD CONSTRAINT [PK_BcCustomerAddress] PRIMARY KEY CLUSTERED ([BcCustomerAddressId]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_BcCustomerAddress_BcId] ON [dbo].[BcCustomerAddress] ([BcId]) INCLUDE ([AccountingCustomerAddressFid]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[BcCustomerAddress] ADD CONSTRAINT [FK_BcCustomerAddress_AccountingCustomerAddress] FOREIGN KEY ([AccountingCustomerAddressFid]) REFERENCES [dbo].[AccountingCustomerAddress] ([AccountingCustomerAddressId]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[BcCustomerAddress] TO [MssExec]
GRANT INSERT ON [dbo].[BcCustomerAddress] TO [MssExec]
GRANT DELETE ON [dbo].[BcCustomerAddress] TO [MssExec]
GRANT UPDATE ON [dbo].[BcCustomerAddress] TO [MssExec]
GO