IF NOT EXISTS ( SELECT * FROM SYS.OBJECTS WHERE NAME = 'EST_NF_ENT_DANFE_CTE_EMIT' )
BEGIN 

	CREATE TABLE [DBO].[EST_NF_ENT_DANFE_CTE_EMIT] (
	  [CD_CTR]	INT NOT NULL,
	  [CNPJ]	VARCHAR(20) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
	  [IE]		VARCHAR(20) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
	  [XNOME]	VARCHAR(350)COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
	  [XLGR]	VARCHAR(350)COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS ,
	  [NRO]		VARCHAR(30) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
	  [XBAIRRO] VARCHAR(350)COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS ,
	  [CMUN]	INT NULL,
	  [XMUN]	VARCHAR(20) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
	  [CEP]		INT ,
	  [UF]		VARCHAR(10) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
	  [FONE]	VARCHAR(30) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
	  CONSTRAINT [EST_NF_ENT_DANFE_CTE_EMIT_EMI_FK] FOREIGN KEY ([CD_CTR]) REFERENCES [DBO].[EST_NF_ENT_DANFE_CTE] ([CD_CTR]) 
	  ON UPDATE NO ACTION
	  ON DELETE CASCADE
	)
	ON [PRIMARY]



END 