CREATE TABLE [dbo].[external_customer_references] (
   [api_type] [varchar](50) NOT NULL,
   [api_id] [varchar](50) NOT NULL,
   [customer_number] [int] NOT NULL,
   [subsidiary] [int] NOT NULL,
   [reference] [varchar](255) NULL,
   [last_received_time] [datetime] NULL,
   [version] [varchar](100) NULL,
   [client_db] [varchar](20) NOT NULL

   ,CONSTRAINT [external_customer_references$0] PRIMARY KEY CLUSTERED ([api_type], [api_id], [customer_number], [subsidiary], [client_db])
)


GO
