if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PagamentiCassa]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

BEGIN
/****** Object:  Table [dbo].[PagamentiCassa]    Script Date: 02/05/2021 15:20:52 ******/
SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

SET ANSI_PADDING ON

CREATE TABLE [dbo].[PagamentiCassa](
	[IDPAGAMENTOCASSA] [int] NOT NULL,
	[DESC_PAGAMENTO] [varchar](30) NOT NULL,
	[NUM_PAGAMENTO] [int] NOT NULL,
	[ID_TIPOPAGAMENTO] [int] NOT NULL,
 CONSTRAINT [PK_PagamentiCassa] PRIMARY KEY CLUSTERED 
(
	[IDPAGAMENTOCASSA] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

SET ANSI_PADDING OFF

INSERT [dbo].[PagamentiCassa] ([IDPAGAMENTOCASSA], [DESC_PAGAMENTO], [NUM_PAGAMENTO],[ID_TIPOPAGAMENTO]) VALUES (0, N'CONTANTI', 1,100)
INSERT [dbo].[PagamentiCassa] ([IDPAGAMENTOCASSA], [DESC_PAGAMENTO], [NUM_PAGAMENTO],[ID_TIPOPAGAMENTO]) VALUES (1, N'CARTA CREDITO', 4,101)
INSERT [dbo].[PagamentiCassa] ([IDPAGAMENTOCASSA], [DESC_PAGAMENTO], [NUM_PAGAMENTO],[ID_TIPOPAGAMENTO]) VALUES (2, N'NON PAGATO', 2,102)

/****** Object:  Default [DF_PagamentiCassa_NUM_PAGAMENTO]    Script Date: 02/05/2021 15:20:52 ******/
ALTER TABLE [dbo].[PagamentiCassa] ADD  CONSTRAINT [DF_PagamentiCassa_NUM_PAGAMENTO]  DEFAULT ((0)) FOR [NUM_PAGAMENTO]

END
