﻿CREATE TABLE [dbo].[QuoteParam] (
    [QuoteType]  CHAR (1)       CONSTRAINT [DF_QuoteParam_QuoteType] DEFAULT ('Q') NOT NULL,
    [CodQuote]   BIGINT         NOT NULL,
    [QuoteRev]   INT            CONSTRAINT [DF_QuoteParam_QuoteRev] DEFAULT ((0)) NOT NULL,
    [NumP]       INT            NOT NULL,
    [ProcessNum] NVARCHAR (50)  CONSTRAINT [DF_QuoteParam_ProcessNum] DEFAULT ((0)) NOT NULL,
    [Descr]      NVARCHAR (50)  NOT NULL,
    [Parameter]  NVARCHAR (100) CONSTRAINT [DF_QuoteParam_Parameter] DEFAULT ('') NOT NULL,
    CONSTRAINT [PK_QuoteParam] PRIMARY KEY CLUSTERED ([QuoteType] ASC, [CodQuote] ASC, [QuoteRev] ASC, [NumP] ASC) WITH (FILLFACTOR = 90),
    CONSTRAINT [FK_QuoteParam_QuoteList] FOREIGN KEY ([QuoteType], [CodQuote], [QuoteRev]) REFERENCES [dbo].[QuoteList] ([QuoteType], [CodQuote], [QuoteRev]) ON UPDATE CASCADE
);




GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'tipo di preventivo: Q = quote, S = simulation', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteParam', @level2type = N'COLUMN', @level2name = N'QuoteType';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'numero nel formato yyMMddnnnn dove nnn è incrementale giornaliero', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteParam', @level2type = N'COLUMN', @level2name = N'CodQuote';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'progressivo interno', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteParam', @level2type = N'COLUMN', @level2name = N'NumP';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Tipo risorsa (e lavorazione): 01 .. 04', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'QuoteParam', @level2type = N'COLUMN', @level2name = N'ProcessNum';

