Files
Samuele Locatelli a6d7ea0b2f Import iniziale DB, GMW
versione TK 2.4
inclusione schema voc x tabella lingue e vocabolario
2014-02-20 09:54:57 +01:00

39 lines
2.0 KiB
Transact-SQL

CREATE TABLE [dbo].[Celle] (
[IdxCella] INT IDENTITY (1, 1) NOT NULL,
[CodCS] NCHAR (2) NOT NULL,
[CodCella] NVARCHAR (50) NOT NULL,
[IdxTipoCella] INT NULL,
[Descrizione] NVARCHAR (50) NULL,
[Attiva] BIT NULL,
[Piena] BIT CONSTRAINT [DF_Celle_Piena] DEFAULT ((0)) NOT NULL,
[IdxBlocco] INT CONSTRAINT [DF_Celle_IdxBlocco] DEFAULT ((0)) NOT NULL,
[X] INT NOT NULL,
[Y] INT NOT NULL,
[Z] INT NOT NULL,
CONSTRAINT [PK_Celle] PRIMARY KEY CLUSTERED ([IdxCella] ASC),
CONSTRAINT [FK_Celle_Blocchi] FOREIGN KEY ([IdxBlocco]) REFERENCES [dbo].[Blocchi] ([IdxBlocco]) ON UPDATE CASCADE,
CONSTRAINT [FK_Celle_TipoCella] FOREIGN KEY ([IdxTipoCella]) REFERENCES [dbo].[TipoCella] ([IdxTipoCella])
);
GO
CREATE NONCLUSTERED INDEX [IX_Celle_Attiva_IdxBlocco]
ON [dbo].[Celle]([Attiva] ASC, [IdxBlocco] ASC);
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'indica se sia attiva, se non lo fosse è impedito caricamento nella stessa', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Celle', @level2type = N'COLUMN', @level2name = N'Attiva';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'posizione X (colonna)', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Celle', @level2type = N'COLUMN', @level2name = N'X';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'posizione Y (livello/ripiano)', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Celle', @level2type = N'COLUMN', @level2name = N'Y';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'posizione Z (profondita)', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Celle', @level2type = N'COLUMN', @level2name = N'Z';