﻿CREATE TABLE [dbo].[RevHistory] (
    [RevType]     NVARCHAR (50)  CONSTRAINT [DF_RevHistory_RevType] DEFAULT (N'P') NOT NULL,
    [RevNum]      INT            CONSTRAINT [DF_RevHistory_RevNum] DEFAULT ((0)) NOT NULL,
    [DateRev]     DATETIME       NOT NULL,
    [Description] NVARCHAR (250) CONSTRAINT [DF_RevHistory_Description] DEFAULT ('') NOT NULL,
    CONSTRAINT [PK_RevHistory] PRIMARY KEY CLUSTERED ([RevType] ASC, [RevNum] ASC)
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Tipo di revisione indicata coem S.C.P --> in C = costi di contab industriale, P = da ProductionLog, S = Sistema di calcolo', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'RevHistory', @level2type = N'COLUMN', @level2name = N'RevType';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'incrementale del numero di revisione', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'RevHistory', @level2type = N'COLUMN', @level2name = N'RevNum';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'data revisione', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'RevHistory', @level2type = N'COLUMN', @level2name = N'DateRev';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'descrizione revisione', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'RevHistory', @level2type = N'COLUMN', @level2name = N'Description';

