if not exists(select* from sys.sysobjects where id = object_id(N'dbo.InventoryScan'))
begin
    create table[dbo].[InventoryScan] (
        [ID][uniqueidentifier] NOT NULL,
        [ScanConfigurationID] [uniqueidentifier] NOT NULL,
        [StartDateTime] [datetime2] NULL,
        [StopDateTime] [datetime2] NULL,
        [State] [int] NOT NULL,
        constraint[PK_InventoryScan] primary key clustered(ID)
    );
end;