CREATE TABLE [dbo].[AnagLinee] (
    [CodLinea]      NVARCHAR (5)   NOT NULL,
    [Descrizione]   NVARCHAR (50)  NOT NULL,
    [CodBlocco]     AS             (isnull(left([CodLinea],(3)),'')),
    [CodCella]      AS             ([CodLinea]+'0101'),
    [codPostazione] NVARCHAR (250) CONSTRAINT [DF_AnagLinee_codPostazione] DEFAULT ('') NOT NULL,
    [dtAccess]      DATETIME       NULL,
    [CurrVal]       NVARCHAR (50)  CONSTRAINT [DF_AnagLinee_AL] DEFAULT ('') NOT NULL,
    CONSTRAINT [PK_AnagLinee] PRIMARY KEY CLUSTERED ([CodLinea] ASC)
);




GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Linea impegnata (00 - 99)', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AnagLinee', @level2type = N'COLUMN', @level2name = N'CodLinea';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'postazione correntemente associata', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AnagLinee', @level2type = N'COLUMN', @level2name = N'codPostazione';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'data ora ultimo accesso', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AnagLinee', @level2type = N'COLUMN', @level2name = N'dtAccess';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'AL associato alla linea', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'AnagLinee', @level2type = N'COLUMN', @level2name = N'CurrVal';

