CREATE TABLE [D140-11-2].[DSAHIST_02_ActivityCoreItemHistory](
  [Id] [int] NULL,
  [PlanVersionIdentifier] [nvarchar](100) COLLATE Norwegian_100_CI_AS NULL,
  [ActivityCoreItemId] [int] NULL,
  [ExternalActivityIdentifier] [nvarchar](100) COLLATE Norwegian_100_CI_AS NULL,
  [StartDate] [datetime2](3) NULL,
  [EndDate] [datetime2](3) NULL,
  [ActivationType] [int] NULL,
  [BottleneckSector] [int] NULL,
  [HoursPerWeek] [int] NULL,
  [MinutesPerWeek] [int] NULL,
  [ResponsibleOrgansationType] [int] NULL,
  [ResponsibleOrganisationCode] [int] NULL,
  [ResponsibleCaseWorkerGivenName] [nvarchar](50) COLLATE Norwegian_100_CI_AS NULL,
  [ResponsibleCaseWorkerMiddleName] [nvarchar](40) COLLATE Norwegian_100_CI_AS NULL,
  [ResponsibleCaseWorkerSurName] [nvarchar](40) COLLATE Norwegian_100_CI_AS NULL,
  [ResponsibleCaseWorkerRid] [nvarchar](64) COLLATE Norwegian_100_CI_AS NULL,
  [ResponsibleAuthorityName] [nvarchar](255) COLLATE Norwegian_100_CI_AS NULL,
  [ProviderCVR] [nvarchar](50) COLLATE Norwegian_100_CI_AS NULL,
  [ProviderUnit] [nvarchar](50) COLLATE Norwegian_100_CI_AS NULL,
  [MailDeliverySubLocation] [nvarchar](34) COLLATE Norwegian_100_CI_AS NULL,
  [StreetName] [nvarchar](40) COLLATE Norwegian_100_CI_AS NULL,
  [StreetNameForAdressingName] [nvarchar](20) COLLATE Norwegian_100_CI_AS NULL,
  [StreetBuilding] [nvarchar](10) COLLATE Norwegian_100_CI_AS NULL,
  [FloorIdentifier] [nvarchar](5) COLLATE Norwegian_100_CI_AS NULL,
  [SuiteIdentifier] [nvarchar](4) COLLATE Norwegian_100_CI_AS NULL,
  [DistrictSubdivision] [nvarchar](34) COLLATE Norwegian_100_CI_AS NULL,
  [PostOfficeBox] [int] NULL,
  [PostCode] [nvarchar](4) COLLATE Norwegian_100_CI_AS NULL,
  [DistrictName] [nvarchar](20) COLLATE Norwegian_100_CI_AS NULL,
  [CountryCode] [nvarchar](3) COLLATE Norwegian_100_CI_AS NULL,
  [ContactInformationGivenName] [nvarchar](50) COLLATE Norwegian_100_CI_AS NULL,
  [ContactInformationMiddleName] [nvarchar](40) COLLATE Norwegian_100_CI_AS NULL,
  [ContactInformationSurName] [nvarchar](40) COLLATE Norwegian_100_CI_AS NULL,
  [ContactInformationTelephoneNumber] [nvarchar](20) COLLATE Norwegian_100_CI_AS NULL,
  [ActivityStatus] [int] NULL,
  [ActivityStatusCause] [int] NULL,
  [IncidentDate] [datetime2](3) NULL,
  [SustenanceTypeIdentifier] [int] NULL,
  [ActivityItemType] [int] NULL,
  [ChangeTypeId] [int] NULL,
  [ChangeDate] [datetime2](3) NULL,
  [PlanVersionTypeId] [int] NULL,
  [ObsoleteDate] [datetime2](3) NULL,
  [CoName] [nvarchar](100) COLLATE Norwegian_100_CI_AS NULL,
  [RecordingAuthority] [nvarchar](10) COLLATE Norwegian_100_CI_AS NULL,
  [FirstPublishedDateTime] [datetime2](3) NULL,
  [PersonId] [int] NULL,
  [ActiveOrganisationTypeIdentifier] [smallint] NULL,
  [ActiveOrganisationCode] [int] NULL,
  [UserFullName] [nvarchar](100) COLLATE Norwegian_100_CI_AS NULL,
  [RequestUserTypeIdentifier] [nvarchar](100) COLLATE Norwegian_100_CI_AS NULL,
  [UserIdentifier] [nvarchar](100) COLLATE Norwegian_100_CI_AS NULL,
  [UserEmail] [nvarchar](100) COLLATE Norwegian_100_CI_AS NULL,
  [UserOrganisationTypeIdentifier] [smallint] NULL,
  [UserOrganisationCode] [int] NULL,
  [SYS_KommuneId] [int] NULL,
  [SYS_BatchDate] [datetime2](3) NULL,
  [SYS_RowID] [bigint] identity(1,1) NOT NULL,
  [SYS_ExtractDate] [datetime2](3) NULL,
  [SYS_SourceFileID] [varchar](80) COLLATE Norwegian_100_CI_AS NULL,
  [SYS_RettelserTidAngivelse] [datetime2](3) NULL,
  [SYS_VersionID] [bigint] NULL,
  [SYS_Checksum] AS (CONVERT([bigint],hashbytes('SHA2_256',concat([Id],[PlanVersionIdentifier],[ActivityCoreItemId],[ExternalActivityIdentifier],[StartDate],[EndDate],[ActivationType],[BottleneckSector],[HoursPerWeek],[MinutesPerWeek],[ResponsibleOrgansationType],[ResponsibleOrganisationCode],[ResponsibleCaseWorkerGivenName],[ResponsibleCaseWorkerMiddleName],[ResponsibleCaseWorkerSurName],[ResponsibleCaseWorkerRid],[ResponsibleAuthorityName],[ProviderCVR],[ProviderUnit],[MailDeliverySubLocation],[StreetName],[StreetNameForAdressingName],[StreetBuilding],[FloorIdentifier],[SuiteIdentifier],[DistrictSubdivision],[PostOfficeBox],[PostCode],[DistrictName],[CountryCode],[ContactInformationGivenName],[ContactInformationMiddleName],[ContactInformationSurName],[ContactInformationTelephoneNumber],[ActivityStatus],[ActivityStatusCause],[IncidentDate],[SustenanceTypeIdentifier],[ActivityItemType],[ChangeTypeId],[ChangeDate],[PlanVersionTypeId],[ObsoleteDate],[CoName],[RecordingAuthority],[FirstPublishedDateTime],[PersonId],[ActiveOrganisationTypeIdentifier],[ActiveOrganisationCode],[UserFullName],[RequestUserTypeIdentifier],[UserIdentifier],[UserEmail],[UserOrganisationTypeIdentifier],[UserOrganisationCode])),0)) PERSISTED,
  [SYS_ExecutionId] [bigint] NULL,
  [SYS_DataDeliveryBatchId_Create] [bigint] NULL
) 
on sys_batch_date_sc(SYS_BatchDate)
GO

CREATE UNIQUE CLUSTERED INDEX [IDX_CL_D140-11-2_DSAHIST_02_ActivityCoreItemHistory] On [D140-11-2].[DSAHIST_02_ActivityCoreItemHistory] (SYS_BatchDate, SYS_KommuneId, SYS_RowID) with (data_compression = page, STATISTICS_INCREMENTAL = ON) on sys_batch_date_sc(SYS_BatchDate);
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Historik : Indeholder basisdata for en aktivitet', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitet Id', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'Id';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Relation til PlanVersionIdentifier', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'PlanVersionIdentifier';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Relation til ActivityCoreItem', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ActivityCoreItemId';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Ekstern Aktivitet nummber', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ExternalActivityIdentifier';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitet Startdato', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'StartDate';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitets slut dato', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'EndDate';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktiveringstype - Se GetActivationTypeIdentifierCodeList for definition af udfaldsrum. Fx: løntilskud og virksomhedspraktik. Kolonnen benyttes ikke længere og kan senere blive fjernet', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ActivationType';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Flaskehals', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'BottleneckSector';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Timer pr. uge med praktisk træning', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'HoursPerWeek';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Minutter pr. uge med praktisk træning', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'MinutesPerWeek';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Myndighedstype', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ResponsibleOrgansationType';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Myndighedskode', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ResponsibleOrganisationCode';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Sagsbehandlerens fornavn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ResponsibleCaseWorkerGivenName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Sagsbehandlerens mellemnavn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ResponsibleCaseWorkerMiddleName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Sagsbehandlerens efternavn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ResponsibleCaseWorkerSurName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Sagsbehandlerens Certificate ID', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ResponsibleCaseWorkerRid';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Myndighedsnavn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ResponsibleAuthorityName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetsudbyder (CVR)', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ProviderCVR';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetsudbyders P-nummer', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ProviderUnit';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted bygning', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'MailDeliverySubLocation';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted gadenavn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'StreetName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted adresseringsvejnavn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'StreetNameForAdressingName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted nummer', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'StreetBuilding';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted etage', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'FloorIdentifier';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted lejlighed', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SuiteIdentifier';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted landsby', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'DistrictSubdivision';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted postbox', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'PostOfficeBox';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted postnummer', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'PostCode';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted by', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'DistrictName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktivitetssted land Kode', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'CountryCode';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Kontaktperson fornavn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ContactInformationGivenName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Kontaktperson mellemnavn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ContactInformationMiddleName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Kontaktperson efternavn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ContactInformationSurName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Kontaktperson telefon', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ContactInformationTelephoneNumber';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Kodeliste værdi fra DFDG.', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ActivityStatus';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Kodeliste værdi fra DFDG.', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ActivityStatusCause';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Hændelsesdato', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'IncidentDate';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Kodeliste værdi fra DFDG. (Forsørgelsestype)', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SustenanceTypeIdentifier';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Aktiveringstype - Se GetActivationTypeIdentifierCodeList for definition af udfaldsrum. Fx: løstilskud og virksomhedspraktik.', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ActivityItemType';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Ændringtype', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ChangeTypeId';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Opdateretdato', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ChangeDate';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Kodeliste værdi fra DFDG. (Planversiontype)', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'PlanVersionTypeId';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'forældet dato', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ObsoleteDate';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'C/O Navn', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'CoName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Myndighedskode på det oprettende jobcenter.', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'RecordingAuthority';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Hændelsesdato for hvornår den aktiviteten første gang blev publiceret.', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'FirstPublishedDateTime';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Borgers interne identifikation', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'PersonId';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Den myndighed som der er registreret på vegne af (v/ AA: som brugeren har impersonated). Det er den ansvarlige myndighed', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ActiveOrganisationTypeIdentifier';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Koden som identificerer organisationen. Det kan være Jobcenternummer, et CVR nummer, en a-kassekode eller en kommunekode. Det er den ansvarlige myndighed', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'ActiveOrganisationCode';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Brugers fulde navn, ved systemkald angives systemets og jobbets navn her', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'UserFullName';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Brugers type, system, sagsbehandler, borger', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'RequestUserTypeIdentifier';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Unik identifikation af brugeren, f.eks. en GUID, et medarbejder ID, system ID, bruger ID, certifikat ID, cpr-nummer, email', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'UserIdentifier';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Brugerens e-mail adresse', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'UserEmail';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Kodeliste som identificerer typen af organisationen som brugeren hører til', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'UserOrganisationTypeIdentifier';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Koden som identificerer organisationen som brugeren hører til. Det kan være et Jobcenternummer, CVR nummer, en a-kassekode eller en kommunekode', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'UserOrganisationCode';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Dette er en teknisk Kolonne i FLIS. Indeholder nummeret på den kommune, som rækken tilhører', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_KommuneId';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Dette er en teknisk Kolonne i FLIS. Indeholder information om, hvilken batch rækken er indlæst i', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_BatchDate';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Dette er en teknisk Kolonne i FLIS. Indeholder et fortløbende nummer, så alle rækker i tabellen har et unikt nummer', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_RowID';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Dette er en teknisk Kolonne i FLIS. Indeholder det dato stempel, som kildefilen er markeret med', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_ExtractDate';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Dette er en teknisk Kolonne i FLIS. Indeholder ID for den primære snitflade, hvor data i rækken stammer fra', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_SourceFileID';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Dette er en teknisk Kolonne i FLIS. Indeholder den forretningsmæssige tidsangivelse for rækken. Denne bruges hvis data skal slettes med tidsangivelse', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_RettelserTidAngivelse';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Dette er en teknisk Kolonne i FLIS. Indeholder et versionsnummer for den pågældende række', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_VersionID';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'Dette er en teknisk Kolonne i FLIS. Indeholder cheksum info', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_Checksum';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'SysExecutionId', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_ExecutionId';
GO

EXEC sys.sp_addextendedproperty 
@name = N'MS_Description', 
@value = N'SysDataDeliveryBatchIdCreate', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory', 
@level2type = N'COLUMN', @level2name = N'SYS_DataDeliveryBatchId_Create';
GO

EXEC sys.sp_addextendedproperty 
@name = N'DataArea', 
@value = N'dfdg', 
@level0type = N'SCHEMA', @level0name = N'D140-11-2', 
@level1type = N'TABLE',  @level1name = N'DSAHIST_02_ActivityCoreItemHistory';
GO

