IF  NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PRC_GRP_ECON_CONFIG_PIS_COFINS]') AND type in (N'U'))
begin
/****** Object:  Table [dbo].[PRC_GRP_ECON_CONFIG_PIS_COFINS]    Script Date: 14/04/2014 15:21:10 ******/
CREATE TABLE [dbo].[PRC_GRP_ECON_CONFIG_PIS_COFINS](
	[CD_EMP] [int] NOT NULL,
	[CD_GRP_ECON] [int] NOT NULL,
	[C100] [int] NULL,
	[C180] [int] NULL,
	[C190] [int] NULL,
	[C400] [int] NULL,
	[C490] [int] NULL,
	[C500] [int] NULL,
	[CD_USU] [int] NULL,
	[DT_CAD] [datetime] NULL,
 CONSTRAINT [PK_PRC_GRP_ECON_CONFIG_PIS_COFINS] PRIMARY KEY CLUSTERED 
(
	[CD_EMP] ASC,
	[CD_GRP_ECON] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 95) ON [PRIMARY]
) ON [PRIMARY]

ALTER TABLE [dbo].[PRC_GRP_ECON_CONFIG_PIS_COFINS] ADD  CONSTRAINT [DF_PRC_GRP_ECON_CONFIG_PIS_COFINS_C100]  DEFAULT ((0)) FOR [C100]

ALTER TABLE [dbo].[PRC_GRP_ECON_CONFIG_PIS_COFINS] ADD  CONSTRAINT [DF_PRC_GRP_ECON_CONFIG_PIS_COFINS_C180]  DEFAULT ((0)) FOR [C180]
 
ALTER TABLE [dbo].[PRC_GRP_ECON_CONFIG_PIS_COFINS] ADD  CONSTRAINT [DF_PRC_GRP_ECON_CONFIG_PIS_COFINS_C190]  DEFAULT ((0)) FOR [C190]

ALTER TABLE [dbo].[PRC_GRP_ECON_CONFIG_PIS_COFINS] ADD  CONSTRAINT [DF_PRC_GRP_ECON_CONFIG_PIS_COFINS_C400]  DEFAULT ((0)) FOR [C400]
 
ALTER TABLE [dbo].[PRC_GRP_ECON_CONFIG_PIS_COFINS] ADD  CONSTRAINT [DF_PRC_GRP_ECON_CONFIG_PIS_COFINS_C490]  DEFAULT ((0)) FOR [C490]
 
ALTER TABLE [dbo].[PRC_GRP_ECON_CONFIG_PIS_COFINS] ADD  CONSTRAINT [DF_PRC_GRP_ECON_CONFIG_PIS_COFINS_C500]  DEFAULT ((0)) FOR [C500]
 
END
 
