text: ﻿CREATE TABLE [dbo].[ProviderSite] (
      [ProviderSiteID]                     INT              IDENTITY (-1, -1) NOT FOR REPLICATION NOT NULL,
      [FullName]                           NVARCHAR (255)   NOT NULL,
      [TradingName]                        NVARCHAR (255)   NOT NULL,
      [EDSURN]                             INT              NOT NULL,
      [AddressLine1]                       NVARCHAR (50)    NOT NULL,
      [AddressLine2]                       NVARCHAR (50)    NULL,
      [AddressLine3]                       NVARCHAR (50)    NULL,
      [AddressLine4]                       NVARCHAR (50)    NULL,
      [AddressLine5]                       NVARCHAR (50)    NULL,
      [Town]                               NVARCHAR (50)    NOT NULL,
      [CountyId]                           INT              NOT NULL,
      [PostCode]                           NVARCHAR (8)     NOT NULL,
      [LocalAuthorityId]                   INT              NULL,
      [ManagingAreaID]                     INT              NULL,
      [Longitude]                          DECIMAL (13, 10) NULL,
      [Latitude]                           DECIMAL (13, 10) NULL,
      [GeocodeEasting]                     INT              NULL,
      [GeocodeNorthing]                    INT              NULL,
      [OwnerOrganisation]                  NVARCHAR (255)   NULL,
      [EmployerDescription]                NVARCHAR (MAX)   NULL,
      [CandidateDescription]               NVARCHAR (MAX)   NULL,
      [WebPage]                            NVARCHAR (100)   NULL,
      [OutofDate]                          BIT              NOT NULL,
      [ContactDetailsForEmployer]          NVARCHAR (256)   NULL,
      [ContactDetailsForCandidate]         NVARCHAR (256)   NULL,
      [HideFromSearch]                     BIT              NOT NULL,
      [TrainingProviderStatusTypeId]       INT              NULL,
      [IsRecruitmentAgency]                BIT              CONSTRAINT [SiteProvider_IsRecruitmentAgency] DEFAULT ((0)) NOT NULL,
      [ContactDetailsAsARecruitmentAgency] NVARCHAR (1000)  NULL,
      CONSTRAINT [PK_Training_Provider] PRIMARY KEY CLUSTERED ([ProviderSiteID] ASC),
      CONSTRAINT [FK_TrainingProvider_County] FOREIGN KEY ([CountyId]) REFERENCES [dbo].[County] ([CountyId]),
      CONSTRAINT [FK_TrainingProvider_EmployerTrainingProviderStatus] FOREIGN KEY ([TrainingProviderStatusTypeId]) REFERENCES [dbo].[EmployerTrainingProviderStatus] ([EmployerTrainingProviderStatusId]),
      CONSTRAINT [FK_TrainingProvider_LocalAuthority] FOREIGN KEY ([LocalAuthorityId]) REFERENCES [dbo].[LocalAuthority] ([LocalAuthorityId]),
      CONSTRAINT [uq_idx_trainingProvider] UNIQUE NONCLUSTERED ([EDSURN] ASC)
  );
  
  