Torna al Thread
CREATE TABLE [dbo].[Ctt4](
[id] [int] IDENTITY(1,1) NOT NULL,
[anno] [int] NULL,
[codcomune] [int] NOT NULL,
[codcategoria] [int] NULL,
[totstrutture] [int] NULL,
[totcamere] [int] NULL,
[totletti] [int] NULL,
[totbagni] [int] NULL,
CONSTRAINT [PK_Ctt4] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Ctt4] WITH CHECK ADD CONSTRAINT [FK_Ctt4_comuni] FOREIGN KEY([codcomune])
REFERENCES [dbo].[comuni] ([codcomune])
GO
ALTER TABLE [dbo].[Ctt4] CHECK CONSTRAINT [FK_Ctt4_comuni]