CREATE TABLE [dbo].[TipoCella] (
    [IdxTipoCella] INT           IDENTITY (1, 1) NOT NULL,
    [CodMag]       NVARCHAR (50) NOT NULL,
    [CodCS]        NCHAR (2)     NOT NULL,
    [Quantita]     INT           NOT NULL,
    [Capienza]     INT           NOT NULL,
    [Max_X]        FLOAT (53)    NULL,
    [Max_Y]        FLOAT (53)    NULL,
    [Max_Z]        FLOAT (53)    NULL,
    [Max_Kg]       FLOAT (53)    NULL,
    [CheckPiena]   BIT           CONSTRAINT [DF_TipoCella_CheckPiena] DEFAULT ((0)) NOT NULL,
    [SetMag]       BIT           CONSTRAINT [DF_TipoCella_SetMag] DEFAULT ((1)) NULL,
    CONSTRAINT [PK_TipoCella] PRIMARY KEY CLUSTERED ([IdxTipoCella] ASC),
    CONSTRAINT [FK_TipoCella_AnagMag] FOREIGN KEY ([CodMag], [CodCS]) REFERENCES [dbo].[AnagMag] ([CodMag], [CodCS]) ON UPDATE CASCADE
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = 'determina se deve o meno impostare il magazzino logico (contabile)', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'TipoCella', @level2type = N'COLUMN', @level2name = N'SetMag';

