IF  NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BC_ADIANT_HOTEL]') AND type in (N'U'))
begin
CREATE TABLE [dbo].[BC_ADIANT_HOTEL](
	[CD_ADIANT] [int] NOT NULL,
	[CD_CTR] [int] NOT NULL,
	[CD_CID] [int] NOT NULL,
	[VLR_HOTEL] [money] NOT NULL,
 CONSTRAINT [PK_BC_ADIANT_HOTEL] PRIMARY KEY CLUSTERED 
(
	[CD_ADIANT] ASC,
	[CD_CTR] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

ALTER TABLE [dbo].[BC_ADIANT_HOTEL]  WITH CHECK ADD  CONSTRAINT [FK_BC_ADIANT_HOTEL_BC_ADIANT] FOREIGN KEY([CD_ADIANT])
REFERENCES [dbo].[BC_ADIANT] ([CD_ADIANT])
ON UPDATE CASCADE

ALTER TABLE [dbo].[BC_ADIANT_HOTEL] CHECK CONSTRAINT [FK_BC_ADIANT_HOTEL_BC_ADIANT]

ALTER TABLE [dbo].[BC_ADIANT_HOTEL]  WITH CHECK ADD  CONSTRAINT [FK_BC_ADIANT_HOTEL_GLB_CID] FOREIGN KEY([CD_CID])
REFERENCES [dbo].[GLB_CID] ([CD_CID])

ALTER TABLE [dbo].[BC_ADIANT_HOTEL] CHECK CONSTRAINT [FK_BC_ADIANT_HOTEL_GLB_CID]

ALTER TABLE [dbo].[BC_ADIANT_HOTEL] ADD  CONSTRAINT [DF_BC_ADIANT_HOTEL_CD_ADIANT]  DEFAULT ((0)) FOR [CD_ADIANT]

ALTER TABLE [dbo].[BC_ADIANT_HOTEL] ADD  CONSTRAINT [DF_BC_ADIANT_HOTEL_CD_CTR]  DEFAULT ((0)) FOR [CD_CTR]

ALTER TABLE [dbo].[BC_ADIANT_HOTEL] ADD  CONSTRAINT [DF_BC_ADIANT_HOTEL_CD_CID]  DEFAULT ((0)) FOR [CD_CID]

ALTER TABLE [dbo].[BC_ADIANT_HOTEL] ADD  CONSTRAINT [DF_BC_ADIANT_HOTEL_VLR_HOTEL]  DEFAULT ((0)) FOR [VLR_HOTEL]
end