IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='PRC_REGUA') 
BEGIN
CREATE TABLE PRC_REGUA (
	CD_EMP int NOT NULL,
	CD_FILIAL int NOT NULL,
	CNPJ varchar(14) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	CD_STATUS varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	DS_STATUS varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
	MENSAGEM varchar(8000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	MENSAGEM_ERRO varchar(8000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	DT_ULT_STATUS datetime DEFAULT getdate() NOT NULL,
	ULT_CD_STATUS varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	ULT_DS_STATUS varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	ULT_MENSAGEM varchar(8000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	CONSTRAINT PRC_REGUA_PK PRIMARY KEY (CD_EMP,CD_FILIAL,CNPJ)
)
END