CREATE TABLE [APR_CTTCANDIDATO](
	[CodigoAutomatico] [int] IDENTITY(1,1) NOT NULL,
	[CodigoUsuario] [int] NULL,
	[GUID] [varchar](36) NULL,
	[ParentGUID] [varchar](36) NULL,
	[Nome] [nvarchar](100) NULL,
	[Rg] [nvarchar](100) NULL,
	[EstadoCivil] [nvarchar](100) NULL,
	[EstaTrabalhando] [nvarchar](100) NULL,
	[IDADE] [int] NULL,
	[CPF] [nvarchar](100) NULL,
	[FEEDBACK] [nvarchar](100) NULL,
	[COMENTARIO] [nvarchar](100) NULL,
PRIMARY KEY CLUSTERED 
(
	[CodigoAutomatico] ASC
))

GO
CREATE TABLE [APR_CTTCONTRATA](
	[CodigoAutomatico] [int] IDENTITY(1,1) NOT NULL,
	[CodigoUsuario] [int] NULL,
	[GUID] [varchar](36) NULL,
	[ParentGUID] [varchar](36) NULL,
	[DataInicio] [datetime] NULL,
	[TipoContratacao] [nvarchar](100) NULL,
	[Valor] [decimal](16, 2) NULL,
	[USERNAME] [nvarchar](100) NULL,
	[PASSWORD] [nvarchar](100) NULL,
	[EMAIL] [nvarchar](100) NULL,
	[EMAILPWD] [nvarchar](100) NULL,
PRIMARY KEY CLUSTERED 
(
	[CodigoAutomatico] ASC
))

GO
CREATE TABLE [APR_CTTVAGA](
	[CodigoAutomatico] [int] IDENTITY(1,1) NOT NULL,
	[CodigoUsuario] [int] NULL,
	[GUID] [varchar](36) NULL,
	[ParentGUID] [varchar](36) NULL,
	[TituloVaga] [nvarchar](100) NULL,
	[Departamento] [nvarchar](100) NULL,
	[Perfil] [nvarchar](100) NULL,
	[Nivel] [nvarchar](100) NULL,
PRIMARY KEY CLUSTERED 
(
	[CodigoAutomatico] ASC
))

GO
CREATE TABLE [APR_PEDCLI](
	[CodigoAutomatico] [int] IDENTITY(1,1) NOT NULL,
	[CodigoUsuario] [int] NULL,
	[GUID] [varchar](36) NULL,
	[ParentGUID] [varchar](36) NULL,
	[NOME] [nvarchar](100) NULL,
	[CONTATO] [nvarchar](100) NULL,
	[TELEFONE] [nvarchar](100) NULL,
	[EMAIL] [nvarchar](100) NULL,
	[ENDERECO] [nvarchar](100) NULL,
	[CNPJ] [nvarchar](100) NULL,
 CONSTRAINT [PK_APR_PEDCLI] PRIMARY KEY CLUSTERED 
(
	[CodigoAutomatico] ASC
))

GO
CREATE TABLE [APR_PEDITEM](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[USERID] [int] NOT NULL,
	[ITEMGUID] [varchar](36) NOT NULL,
	[PARENTGUID] [varchar](36) NULL,
	[ITEMID] [int] NULL,
	[N_PRODUTO] [varchar](100) NULL,
	[N_PRODUTO_TXT] [varchar](100) NULL,
	[N_QUANTIDADE] [int] NULL,
	[N_VALOR] [decimal](30, 6) NULL,
 CONSTRAINT [PK_APR_PEDITEM] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
))

GO
CREATE TABLE [APR_PEDJUSTIFICATIVA](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[USERID] [int] NOT NULL,
	[ITEMGUID] [varchar](36) NOT NULL,
	[PARENTGUID] [varchar](36) NULL,
	[ITEMID] [int] NULL,
	[N_JUSTIFICATIVA] [varchar](100) NULL,
 CONSTRAINT [PK_APR_PEDJUSTIFICATIVA] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
))

GO
CREATE TABLE [APR_PEDPEDIDO](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[USERID] [int] NOT NULL,
	[ITEMGUID] [varchar](36) NOT NULL,
	[PARENTGUID] [varchar](36) NULL,
	[ITEMID] [int] NULL,
	[N_NUMPEDIDO] [varchar](100) NULL,
	[N_CLIENTE] [varchar](100) NULL,
	[N_ACAO] [varchar](100) NULL CONSTRAINT [DF_APR_PEDPEDIDO_N_ACAO]  DEFAULT ('ADD'),
 CONSTRAINT [PK_APR_PEDPEDIDO] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
))

GO
CREATE TABLE [APR_RDVITEM](
	[CodigoAutomatico] [int] IDENTITY(1,1) NOT NULL,
	[CodigoUsuario] [int] NULL,
	[GUID] [varchar](36) NULL,
	[ParentGUID] [varchar](36) NULL,
	[CentroCusto] [nvarchar](100) NULL,
	[Cliente] [nvarchar](100) NULL,
	[TipoCusto] [nvarchar](100) NULL,
	[Valor] [decimal](16, 2) NULL,
PRIMARY KEY CLUSTERED 
(
	[CodigoAutomatico] ASC
))

GO
CREATE TABLE [APR_RDVJUS](
	[CodigoAutomatico] [int] IDENTITY(1,1) NOT NULL,
	[CodigoUsuario] [int] NULL,
	[GUID] [varchar](36) NULL,
	[ParentGUID] [varchar](36) NULL,
	[Justificativa] [nvarchar](100) NULL,
PRIMARY KEY CLUSTERED 
(
	[CodigoAutomatico] ASC
))

GO
CREATE TABLE [APR_RDVSOLIC](
	[CodigoAutomatico] [int] IDENTITY(1,1) NOT NULL,
	[CodigoUsuario] [int] NULL,
	[GUID] [varchar](36) NULL,
	[ParentGUID] [varchar](36) NULL,
	[Solicitante] [nvarchar](100) NULL,
PRIMARY KEY CLUSTERED 
(
	[CodigoAutomatico] ASC
))

GO
CREATE TABLE [CNEDT_EDITORIA](
	[EDT_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[EDT_C_NOME] [nvarchar](200) NOT NULL,
	[EDT_C_READERS] [nvarchar](200) NOT NULL,
	[EDT_C_EDITORS] [nvarchar](200) NOT NULL,
 CONSTRAINT [PK_CNEDT_EDITORIA] PRIMARY KEY CLUSTERED 
(
	[EDT_N_ID] ASC
))

GO
CREATE TABLE [CNNED_NOTICIA_EDITORIA](
	[NED_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[NED_N_NOT_N_ID] [int] NOT NULL,
	[NED_N_EDT_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_CNNED_NOTICIA_EDITORIA] PRIMARY KEY CLUSTERED 
(
	[NED_N_ID] ASC
))

GO
CREATE TABLE [CNNOT_NOTICIA](
	[NOT_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[NOT_C_TITULO] [varchar](300) NOT NULL,
	[NOT_C_SUBTITULO] [varchar](300) NOT NULL,
	[NOT_D_CRIACAO] [datetime] NOT NULL,
	[NOT_N_CRIADOR] [int] NOT NULL,
	[NOT_D_INICIO] [datetime] NULL,
	[NOT_D_FINAL] [datetime] NULL,
	[NOT_C_IMG_BANNER] [varchar](300) NULL,
	[NOT_C_OLHO_NOTICIA] [varchar](1000) NOT NULL,
	[NOT_C_IMG_OLHO] [varchar](300) NULL,
	[NOT_C_FONTE] [varchar](100) NOT NULL,
	[NOT_N_DESTAQUE] [bit] NOT NULL,
	[NOT_C_CONTEUDO] [text] NOT NULL,
	[NOT_C_READERS] [varchar](200) NOT NULL,
	[NOT_N_PAGEID] [int] NOT NULL,
	[NOT_C_INDEX] [varchar](1000) NULL,
 CONSTRAINT [PK_CNNOT_NOTICIA] PRIMARY KEY CLUSTERED 
(
	[NOT_N_ID] ASC
))

GO
CREATE TABLE [FFCW_FORMCHILDWORKFLOW](
	[FCW_ATV_N_CODIGO] [int] NOT NULL,
	[FCW_C_ATTACHALIAS] [nvarchar](50) NULL,
	[FCW_B_ISPARENTMULTIPLE] [bit] NULL,
	[FCW_C_CHILDALIAS] [nvarchar](150) NULL,
	[FCW_C_PARENTALIAS] [nvarchar](150) NULL,
	[FCW_N_PARENTACTIVITYID] [int] NULL,
	[FCW_C_PARENTCONTROL] [nvarchar](50) NULL,
	[FCW_C_ACCESSLIST] [nvarchar](300) NULL,
 CONSTRAINT [PK_FCW_ATV_N_CODIGO] PRIMARY KEY CLUSTERED 
(
	[FCW_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [FFOR_FORMULARIO](
	[FOR_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[FOR_N_POR_N_CODIGO] [int] NOT NULL,
	[FOR_N_ARE_N_CODIGO] [int] NOT NULL,
	[FOR_C_TITULO] [varchar](60) NULL,
	[FOR_C_APELIDO] [varchar](100) NOT NULL,
	[FOR_N_VINCULA_USUARIO] [smallint] NOT NULL,
	[FOR_B_SYSTEMFORM] [bit] NOT NULL CONSTRAINT [DF_FFOR_FORMULARIO_FOR_B_SYSTEMFORM]  DEFAULT ((0)),
	[FOR_D_PUBLICACAO] [datetime] NULL,
	[FOR_N_USU_PUBLICADOR] [int] NULL,
 CONSTRAINT [PK_FFOR_FORMULARIO] PRIMARY KEY CLUSTERED 
(
	[FOR_N_CODIGO] ASC
))

GO
CREATE TABLE [FFXI_FORMULARIO_ITEM_PROCESSO](
	[FXI_N_ITE_N_CODIGO] [int] NOT NULL,
	[FXI_N_FOR_N_CODAUTOMATICO] [int] NOT NULL,
	[FXI_C_FOR_C_APELIDO] [varchar](30) NOT NULL,
	[FXI_C_FOR_C_GUID] [varchar](36) NOT NULL,
	[FXI_ISP_N_ID] [int] NULL,
 CONSTRAINT [PK_FFXI_FORMULARIO_ITEM_PROCESSO] PRIMARY KEY CLUSTERED 
(
	[FXI_N_ITE_N_CODIGO] ASC,
	[FXI_N_FOR_N_CODAUTOMATICO] ASC,
	[FXI_C_FOR_C_APELIDO] ASC,
	[FXI_C_FOR_C_GUID] ASC
))

GO
CREATE TABLE [FFXM_FORM_MODULO_INFO](
	[FXM_N_FOR_N_CODIGO] [int] NOT NULL,
	[FXM_N_MOI_N_CODIGO] [int] NOT NULL,
 CONSTRAINT [PK_FFXM_FORM_MODULO_INFO] PRIMARY KEY CLUSTERED 
(
	[FXM_N_FOR_N_CODIGO] ASC,
	[FXM_N_MOI_N_CODIGO] ASC
))

GO
CREATE TABLE [FFXW_FORMULARIO_WORKFLOW](
	[FXW_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[FXW_N_NODE_ID] [int] NOT NULL,
	[FXW_C_FOR_C_APELIDO] [varchar](30) NOT NULL,
	[FXW_N_MULTIPLO] [smallint] NOT NULL,
	[FXW_C_ACESSO_ANEXO] [varchar](100) NULL,
	[FXW_C_DADOS] [text] NULL,
	[FXW_C_DIV] [varchar](4000) NULL,
	[FXW_C_DIVEDIT] [varchar](4000) NULL,
 CONSTRAINT [PK_FFXW] PRIMARY KEY CLUSTERED 
(
	[FXW_N_ID] ASC
))

GO
CREATE TABLE [FMOD_MODULO](
	[MOD_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[MOD_C_OWNERID] [uniqueidentifier] NULL,
	[MOD_C_ITEMID] [uniqueidentifier] NOT NULL CONSTRAINT [DF_FMOD_MODULO_MOD_C_ITEMID]  DEFAULT (newid()),
	[MOD_C_TITULO] [varchar](40) NOT NULL,
	[MOD_C_NOME_CONTROLE] [varchar](15) NOT NULL CONSTRAINT [DF_FMOD_MODULO_MOD_C_NOME_CONTROLE]  DEFAULT (''),
	[MOD_C_TIPO_CONTROLE] [varchar](100) NOT NULL,
	[MOD_C_ICONE] [varchar](150) NOT NULL,
	[MOD_C_IMAGEM_CONTROLE] [varchar](150) NOT NULL,
	[MOD_C_CATEGORIA] [varchar](40) NOT NULL CONSTRAINT [DF_FMOD_MODULO_MOD_C_CATEGORIA]  DEFAULT (''),
 CONSTRAINT [PK_FMOD_MODULO] PRIMARY KEY CLUSTERED 
(
	[MOD_N_CODIGO] ASC
))

GO
CREATE TABLE [GLGAL_GALLERY](
	[GAL_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[GAL_C_DESCRIPTION] [varchar](200) NOT NULL,
	[GAL_N_ARE_N_ID] [int] NOT NULL,
	[GAL_C_PATH] [varchar](200) NULL,
 CONSTRAINT [PK_GLGAL_GALERIA] PRIMARY KEY CLUSTERED 
(
	[GAL_N_ID] ASC
))

GO
CREATE TABLE [GLITM_GALLERY_ITEM](
	[ITM_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[ITM_N_GAL_N_ID] [int] NOT NULL,
	[ITM_C_DESCRIPTION] [varchar](200) NOT NULL,
	[ITM_C_FILENAME] [varchar](200) NOT NULL,
	[ITM_C_TITLE] [varchar](100) NULL,
	[ITM_N_ORDER] [int] NULL,
 CONSTRAINT [PK_GLIMG_IMAGEM] PRIMARY KEY CLUSTERED 
(
	[ITM_N_ID] ASC
))

GO
CREATE TABLE [MWARQ_ARQUIVO](
	[ARQ_N_ATV_N_CODIGO] [int] NOT NULL,
	[ARQ_C_LISTAACESSO] [varchar](100) NOT NULL,
	[ARQ_C_TEXTO] [text] NOT NULL,
	[ARQ_C_EXT] [varchar](20) NULL,
	[ARQ_C_ALIAS] [varchar](50) NULL,
 CONSTRAINT [PK_MWARQ_ARQUIVO] PRIMARY KEY CLUSTERED 
(
	[ARQ_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWCET_CANCELAETAPA](
	[CET_N_ATV_N_CODIGO] [int] NOT NULL,
	[CET_N_ETAPAID] [int] NOT NULL,
 CONSTRAINT [PK_MWCET_CANCELAETAPA] PRIMARY KEY CLUSTERED 
(
	[CET_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWDLN_DEADLINE](
	[DLN_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[DLN_N_ATV_N_CODIGO] [int] NOT NULL,
	[DLN_N_PRZ_N_CODIGO] [int] NOT NULL,
	[DLN_N_REQUIRED] [bit] NOT NULL,
	[DLN_C_PRESET] [varchar](300) NULL,
 CONSTRAINT [PK_MWDLN_DEADLINE] PRIMARY KEY CLUSTERED 
(
	[DLN_N_CODIGO] ASC
))

GO
CREATE TABLE [MWEML_EMAIL](
	[EML_N_ATV_N_CODIGO] [int] NOT NULL,
	[EML_C_TITULO] [varchar](500) NULL,
	[EML_C_TEXTO] [text] NOT NULL,
	[EML_C_DESTINATARIOS] [text] NOT NULL,
	[EML_C_DESTINATARIOSCOPIA] [text] NULL,
	[EML_C_DESTINATARIOSCOPIAOCULTA] [varchar](max) NULL,
	[EML_C_ANEXOS] [text] NOT NULL,
	[EML_N_EDITDEST] [bit] NOT NULL,
	[EML_N_EDITCONTENT] [bit] NOT NULL,
	[EML_C_SENDER] [varchar](150) NOT NULL,
	[EML_N_PLAINTEXT] [bit] NOT NULL DEFAULT ((0)),
 CONSTRAINT [PK_MWEML_EMAIL] PRIMARY KEY CLUSTERED 
(
	[EML_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWEXT_DADOSEXTERNOS](
	[EXT_N_ATV_N_CODIGO] [int] NOT NULL,
	[EXT_N_PRO_N_CODIGO] [int] NOT NULL,
	[EXT_C_ATTACHMENTALIAS] [nvarchar](50) NULL,
 CONSTRAINT [PK_MWEXT_DADOSEXTERNOS] PRIMARY KEY CLUSTERED 
(
	[EXT_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWFIL_FILTRODINAMICO](
	[FIL_N_ATV_N_CODIGO] [int] NOT NULL,
	[FIL_N_ETA_N_CODIGO] [int] NOT NULL,
	[FIL_C_FILTRO] [varchar](250) NOT NULL,
	[FIL_B_REPLACEFILTER] [bit] NOT NULL DEFAULT ((0)),
 CONSTRAINT [PK_MWFIL_FILTRODINAMICO] PRIMARY KEY CLUSTERED 
(
	[FIL_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWFUS_FILTROUSUARIO](
	[FUS_N_ATV_N_CODIGO] [int] NOT NULL,
	[FUS_N_ETA_N_CODIGO] [int] NOT NULL,
	[FUS_C_FILTRO] [varchar](250) NOT NULL,
 CONSTRAINT [PK_MWFUS_FILTROUSUARIO] PRIMARY KEY CLUSTERED 
(
	[FUS_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWFXT_FLUXOEXTERNO](
	[FXT_N_ATV_N_CODIGO] [int] NOT NULL,
	[FXT_N_PEN_N_CODIGO] [int] NOT NULL,
	[FXT_N_SINCRONO] [bit] NOT NULL,
	[FXT_N_NOVOITEM] [smallint] NOT NULL,
	[FXT_N_PROPAGAANEXO] [smallint] NULL,
	[FXT_C_LISTAANEXOS] [varchar](2000) NULL,
 CONSTRAINT [PK_MWFXT_FLUXOEXTERNO] PRIMARY KEY CLUSTERED 
(
	[FXT_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWHIE_HIERARQUIA](
	[HIE_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[HIE_N_ATV_N_CODIGO] [int] NOT NULL,
	[HIE_C_NOMEHIERARQUIA] [nvarchar](100) NOT NULL,
	[HIE_N_GRP_N_CODIGO] [int] NOT NULL,
	[HIE_N_PRO_N_CODIGO] [int] NOT NULL,
	[HIE_N_PARENT] [int] NOT NULL,
 CONSTRAINT [PK_MWHIE] PRIMARY KEY CLUSTERED 
(
	[HIE_N_CODIGO] ASC
))

GO
CREATE TABLE [MWMVA_MOVEANEXO](
	[MVA_N_ATV_N_CODIGO] [int] NOT NULL,
	[MVA_C_DESTINO] [varchar](200) NOT NULL,
	[MVA_C_ANEXO] [varchar](100) NOT NULL,
 CONSTRAINT [PK_MWMVA_MOVEANEXO] PRIMARY KEY CLUSTERED 
(
	[MVA_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWPDF_PDFCREATOR](
	[PDF_N_ATV_N_CODIGO] [int] NOT NULL,
	[PDF_C_LISTAACESSO] [varchar](200) NULL,
	[PDF_C_FILENAME] [varchar](200) NOT NULL,
	[PDF_C_CONFIG] [text] NOT NULL,
 CONSTRAINT [PK_MWPDF_PDFCREATOR] PRIMARY KEY CLUSTERED 
(
	[PDF_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWPRC_PROCEDURE](
	[PRC_N_ATV_N_CODIGO] [int] NOT NULL,
	[PRC_C_CONNECTION] [varchar](50) NOT NULL,
	[PRC_C_PROCNAME] [varchar](100) NOT NULL,
	[PRC_C_LISTAACESSO] [varchar](100) NOT NULL,
	[PRC_N_EXPORTXML] [bit] NOT NULL,
	[PRC_C_PARAMETROS] [text] NOT NULL,
	[PRC_N_ALLOWEMPTY] [bit] NOT NULL DEFAULT ((0)),
	[PRC_C_ALIAS] [varchar](50) NULL,
 CONSTRAINT [PK_MWPRC_PROCEDURE] PRIMARY KEY CLUSTERED 
(
	[PRC_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWREG_REGRA](
	[REG_N_ATS_N_CODIGO] [int] NOT NULL,
	[REG_N_ATV_N_CODIGO] [int] NOT NULL,
	[REG_C_CONDICAO] [text] NOT NULL,
 CONSTRAINT [PK_MWREG_REGRA] PRIMARY KEY CLUSTERED 
(
	[REG_N_ATS_N_CODIGO] ASC
))

GO
CREATE TABLE [MWSUB_SUBPROCESS](
	[SUB_N_ATV_N_CODIGO] [int] NOT NULL,
	[SUB_N_PRO_N_CODIGO] [int] NOT NULL,
	[SUB_C_TITULO] [varchar](80) NOT NULL,
	[SUB_N_CALL_ATIVIDADE] [int] NOT NULL,
	[SUB_C_PARAMS] [text] NOT NULL,
	[SUB_C_ATTACHMENT] [varchar](200) NULL,
	[SUB_N_PARALLEL] [int] NULL,
 CONSTRAINT [PK_MWSUB_SUBPROCESS] PRIMARY KEY CLUSTERED 
(
	[SUB_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWTXT_TEXTO](
	[TXT_N_ATV_N_CODIGO] [int] NOT NULL,
	[TXT_C_TEXTO] [text] NOT NULL,
 CONSTRAINT [PK_MWTXT_TEXTO] PRIMARY KEY CLUSTERED 
(
	[TXT_N_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [MWWEB_WEBSERVICE](
	[WEB_ATV_N_CODIGO] [int] NOT NULL,
	[WEB_C_URL] [varchar](300) NOT NULL,
	[WEB_C_METHODNAME] [varchar](100) NOT NULL,
	[WEB_C_PARAMETERS] [text] NULL,
	[WEB_C_OBJECTOUT] [varchar](50) NULL,
	[WEB_C_ACCESSLIST] [varchar](100) NULL,
	[WEB_N_EXPORTXML] [bit] NOT NULL,
	[WEB_C_ALIAS] [varchar](50) NULL,
 CONSTRAINT [PK_MWWEB_WEBSERVICE] PRIMARY KEY CLUSTERED 
(
	[WEB_ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [NCFG_FIELD_CONFIG](
	[CFG_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[CFG_FOR_N_ID] [int] NOT NULL,
	[CFG_C_NAME] [varchar](100) NOT NULL,
	[CFG_C_COLUMNNAME] [varchar](50) NOT NULL,
	[CFG_C_IDENTIFIER] [varchar](50) NOT NULL,
	[CFG_C_CONTROLCLASS] [varchar](200) NULL,
	[CFG_N_ORDER] [int] NOT NULL,
	[CFG_C_METADATA] [varchar](max) NULL,
	[CFG_D_PUBLISHDATE] [datetime] NULL,
	[CFG_N_DELETE] [bit] NULL,
 CONSTRAINT [PK_NCFG_FIELD_CONFIG] PRIMARY KEY CLUSTERED 
(
	[CFG_N_ID] ASC
))

GO
CREATE TABLE [NDSC_DATASOURCE_CONFIG](
	[DSC_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[DSC_C_IDENTIFIER] [varchar](50) NOT NULL,
	[DSC_FOR_N_ID] [int] NOT NULL,
	[DSC_C_TITLE] [varchar](100) NOT NULL,
	[DSC_C_CONTROLCLASS] [varchar](300) NOT NULL,
	[DSC_C_METADATA] [varchar](max) NULL,
 CONSTRAINT [PK_NDSC_DATASOURCE_CONFIG] PRIMARY KEY CLUSTERED 
(
	[DSC_N_ID] ASC
))

GO
CREATE TABLE [NFDC_FIELD_DATACONFIG](
	[FDC_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[FDC_CFG_N_ID] [int] NOT NULL,
	[FDC_C_NAMEKEY] [varchar](20) NULL,
	[FDC_N_FIELDTYPE] [int] NOT NULL,
	[FDC_C_METADATA] [varchar](max) NULL,
 CONSTRAINT [PK_NDC_FIELD_DATACONFIG] PRIMARY KEY CLUSTERED 
(
	[FDC_N_ID] ASC
))

GO
CREATE TABLE [NFIW_FORM_ITEM_WORKFLOW](
	[FIW_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[FIW_IWF_N_ID] [int] NULL,
	[FIW_N_FORM_PK_ID] [int] NULL,
	[FIW_C_FORM_ALIAS] [varchar](200) NULL,
	[FIW_C_FORM_GUID] [varchar](40) NULL,
 CONSTRAINT [PK_NFIW_FORM_ITEM_WORKFLOW] PRIMARY KEY CLUSTERED 
(
	[FIW_N_ID] ASC
))

GO
CREATE TABLE [NFOR_FORM](
	[FOR_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[FOR_C_IDENTIFIER] [varchar](50) NOT NULL,
	[FOR_ARE_N_ID] [int] NOT NULL,
	[FOR_C_RELEASEID] [varchar](40) NULL,
	[FOR_N_RELEASENUM] [int] NOT NULL DEFAULT ((1)),
	[FOR_C_TITLE] [nvarchar](150) NOT NULL,
	[FOR_C_TABLENAME] [varchar](100) NOT NULL,
	[FOR_C_SOURCE] [varchar](max) NULL,
	[FOR_C_METADATA] [varchar](max) NULL,
	[FOR_C_TEMPLATEFILE] [varchar](200) NULL,
	[FOR_D_CREATEDATE] [datetime] NOT NULL DEFAULT (getdate()),
	[FOR_N_CREATOR] [int] NOT NULL,
	[FOR_D_PUBLISHDATE] [datetime] NULL,
	[FOR_N_PUBLISHER] [int] NOT NULL,
	[FOR_B_ISEDITING] [bit] NOT NULL,
	[FOR_N_EDITORID] [int] NOT NULL,
	[FOR_C_OFFLINEUSERS] [varchar](500) NULL,
 CONSTRAINT [PK_NFOR_FORM] PRIMARY KEY CLUSTERED 
(
	[FOR_N_ID] ASC
))

GO
CREATE TABLE [NFPC_FORM_PROCESS_CONFIG](
	[FPC_ATV_N_ID] [int] NOT NULL,
	[FPC_FOR_N_ID] [int] NOT NULL,
	[FPC_FOR_C_IDENTIFIER] [varchar](40) NULL,
	[FPC_C_METADATA] [varchar](max) NULL,
 CONSTRAINT [PK_NFPC_FORM_PROCESS_CONFIG] PRIMARY KEY CLUSTERED 
(
	[FPC_ATV_N_ID] ASC
))

GO
CREATE TABLE [NFXC_FORM_CONTENT](
	[FXM_FOR_N_ID] [int] NOT NULL,
	[FXM_CTT_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_NFXC_FORM_CONTENT] PRIMARY KEY CLUSTERED 
(
	[FXM_FOR_N_ID] ASC,
	[FXM_CTT_N_ID] ASC
))

GO
CREATE TABLE [NOFC_OFFLINE_FORM_CONFIG](
	[OFC_ATV_N_ID] [int] NOT NULL,
	[OFC_FOR_N_ID] [int] NULL,
	[OFC_FOR_C_IDENTIFIER] [varchar](40) NULL,
	[OFC_C_METADATA] [varchar](max) NULL,
 CONSTRAINT [PK_NOFC_OFFLINE_FORM_CONFIG] PRIMARY KEY CLUSTERED 
(
	[OFC_ATV_N_ID] ASC
))

GO
CREATE TABLE [NOFF_OFFLINE_FORM](
	[OFF_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[OFF_OFC_ATV_N_ID] [int] NULL,
	[OFF_IWF_N_ID] [int] NULL,
	[OFF_N_FORM_ID] [int] NULL,
	[OFF_C_FORM_ALIAS] [varchar](200) NULL,
	[OFF_C_METADATA] [varchar](max) NULL,
 CONSTRAINT [PK_NOFF_OFFLINE_FORM] PRIMARY KEY CLUSTERED 
(
	[OFF_N_ID] ASC
))

GO
CREATE TABLE [NOFU_OFFLINE_FORM_USER](
	[OFU_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[OFU_OFF_N_ID] [int] NULL,
	[OFU_USR_N_ID] [int] NULL,
 CONSTRAINT [PK_NOFU_OFFLINE_FORM_USER] PRIMARY KEY CLUSTERED 
(
	[OFU_N_ID] ASC
))

GO
CREATE TABLE [RCAM_CAMPOS](
	[CAM_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[CAM_N_REP_N_CODIGO] [int] NOT NULL,
	[CAM_C_ALIAS] [nvarchar](50) NULL,
	[CAM_C_ACESSO] [varchar](10) NULL,
	[CAM_N_POSICAO] [int] NOT NULL,
	[CAM_N_WIDTH] [int] NOT NULL,
	[CAM_C_APELIDO] [varchar](30) NULL,
	[CAM_N_SEARCH_RANGE] [smallint] NOT NULL,
	[CAM_N_SEARCH_BUSCA] [smallint] NOT NULL,
	[CAM_N_SEARCH_FILTRO] [smallint] NOT NULL,
	[CAM_N_VISIBLE] [smallint] NOT NULL,
	[CAM_N_ORDEM] [int] NULL,
 CONSTRAINT [PK_RCAM] PRIMARY KEY CLUSTERED 
(
	[CAM_N_CODIGO] ASC
))

GO
CREATE TABLE [RFIL_FILTROS](
	[FIL_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[FIL_C_CAM_C_ALIAS] [nvarchar](50) NOT NULL,
	[FIL_N_REP_N_CODIGO] [int] NOT NULL,
	[FIL_C_OPERACAO] [char](2) NOT NULL,
	[FIL_C_VALOR_COMPARACAO] [varchar](100) NOT NULL,
	[FIL_C_TIPO_COMPARACAO] [char](10) NOT NULL,
 CONSTRAINT [PK_RFIL] PRIMARY KEY CLUSTERED 
(
	[FIL_N_CODIGO] ASC
))

GO
CREATE TABLE [RFIP_FILTROS_PROCEDURE](
	[FIP_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[FIP_N_MOI_N_CODIGO] [int] NOT NULL,
	[FIP_C_PARAMETRO] [varchar](50) NOT NULL,
	[FIP_C_PARAMETRO_VALOR] [varchar](100) NOT NULL,
	[FIP_C_PARAMETRO_TIPO] [varchar](50) NOT NULL,
	[FIP_C_TITULO] [varchar](50) NOT NULL,
	[FIP_B_FILTRO] [bit] NOT NULL,
	[FIP_B_NULO] [bit] NOT NULL,
 CONSTRAINT [PK_RFIP] PRIMARY KEY CLUSTERED 
(
	[FIP_N_ID] ASC
))

GO
CREATE TABLE [RREP_REPORTS](
	[REP_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[REP_N_MOI_N_CODIGO] [int] NOT NULL,
	[REP_N_FOR_N_CODIGO] [int] NULL,
	[REP_C_TITULO] [varchar](200) NULL,
	[REP_N_PAGECOUNT] [int] NULL,
	[REP_N_TIPO] [char](2) NOT NULL,
	[REP_C_PARAMETROS] [varchar](2000) NULL,
	[REP_C_PROCEDURE] [varchar](200) NULL,
	[REP_C_LISTAEDICAO] [varchar](200) NULL,
	[REP_C_LISTAEXCLUSAO] [varchar](200) NULL,
	[REP_C_CONNECTION] [varchar](300) NULL,
	[REP_C_TITULOGRAFICO] [nvarchar](100) NULL,
	[REP_N_VISUALIZACAOGRAFICO] [int] NULL,
	[REP_N_LARGURAGRAFICO] [int] NULL,
	[REP_N_ALTURAGRAFICO] [int] NULL,
	[REP_B_MOSTRARVALORESGRAFICO] [bit] NULL,
	[REP_C_CAMPONOMEGRAFICO] [varchar](200) NULL,
	[REP_C_CAMPOVALORGRAFICO] [varchar](200) NULL,
	[REP_C_POSICAOLEGENDAGRAFICO] [int] NULL,
	[REP_C_FUNCAOAGRUPAMENTOGRAFICO] [int] NULL,
	[REP_C_CAMPOAGRUPAMENTO] [varchar](300) NULL,
	[REP_B_VISUALIZAGRAFICO] [bit] NOT NULL DEFAULT ((0)),
 CONSTRAINT [PK_RREP] PRIMARY KEY CLUSTERED 
(
	[REP_N_ID] ASC
))

GO
CREATE TABLE [WACI_ACAO_ITEM](
	[ACI_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ACI_N_IPR_N_CODIGO] [int] NOT NULL,
	[ACI_N_ETI_N_CODIGO] [int] NOT NULL,
	[ACI_N_PRZ_N_ID] [int] NOT NULL,
	[ACI_D_EXECUCAO] [datetime] NOT NULL,
	[ACI_N_TIPO] [smallint] NOT NULL,
	[ACI_C_PARAMETRO] [text] NOT NULL,
	[ACI_N_LOOP] [bit] NOT NULL,
	[ACI_C_NOME] [varchar](50) NOT NULL,
	[ACI_N_ETA_N_CODIGO] [int] NULL,
	[ACI_N_PROCESSO] [smallint] NOT NULL,
 CONSTRAINT [PK_WACI_ACAO_ITEM] PRIMARY KEY CLUSTERED 
(
	[ACI_N_CODIGO] ASC
))

GO
CREATE TABLE [WAGI_AGENDAMENTO_ITEM](
	[AGI_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[AGI_N_IPR_N_CODIGO] [int] NOT NULL,
	[AGI_N_PRZ_N_ID] [int] NOT NULL,
	[AGI_D_EXECUCAO] [datetime] NOT NULL,
	[AGI_C_TIPO] [varchar](5) NOT NULL,
	[AGI_C_SLAID] [varchar](200) NULL,
	[AGI_C_AGCONFIG] [varchar](300) NULL,
 CONSTRAINT [PK_WAGI_AGENDAMENTO_ITEM] PRIMARY KEY CLUSTERED 
(
	[AGI_N_CODIGO] ASC
))

GO
CREATE TABLE [WANF_ANEXO_FINALIZADO](
	[ANF_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ANF_N_IWF_N_CODIGO] [int] NOT NULL,
	[ANF_N_PRO_N_CODIGO] [int] NOT NULL,
	[ANF_N_ATV_N_CODIGO] [int] NOT NULL,
	[ANF_N_TIPO] [int] NOT NULL,
	[ANF_C_ATVALIASANEXO] [varchar](50) NULL,
	[ANF_C_MODULO] [varchar](36) NULL,
	[ANF_C_NOME] [varchar](250) NOT NULL,
	[ANF_C_DESCRICAO] [text] NOT NULL,
	[ANF_C_NOMEARQ] [varchar](250) NULL,
	[ANF_C_CONTENT] [text] NOT NULL,
	[ANF_USU_N_CODIGO] [int] NOT NULL,
	[ANF_C_LISTAACESSO] [varchar](100) NOT NULL,
	[ANF_D_INCLUSAO] [datetime] NOT NULL,
	[ANF_N_ATIVO] [bit] NOT NULL,
	[ANF_B_OCULTO] [bit] NOT NULL,
	[ANF_ISP_N_ID] [int] NULL,
	[ANF_N_ID] [int] NULL,
 CONSTRAINT [PK_WANF_ANEXO_FINALIZADO] PRIMARY KEY CLUSTERED 
(
	[ANF_N_CODIGO] ASC
))

GO
CREATE TABLE [WANX_ANEXO_ITEM](
	[ANX_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ANX_N_IWF_N_CODIGO] [int] NOT NULL,
	[ANX_N_PRO_N_CODIGO] [int] NOT NULL,
	[ANX_N_ATV_N_CODIGO] [int] NOT NULL,
	[ANX_N_TIPO] [int] NOT NULL,
	[ANX_C_ATVALIASANEXO] [varchar](50) NULL,
	[ANX_C_MODULO] [varchar](36) NULL,
	[ANX_C_NOME] [varchar](250) NOT NULL,
	[ANX_C_DESCRICAO] [text] NOT NULL,
	[ANX_C_NOMEARQ] [varchar](250) NULL,
	[ANX_C_CONTENT] [text] NOT NULL,
	[ANX_USU_N_CODIGO] [int] NOT NULL,
	[ANX_C_LISTAACESSO] [varchar](100) NOT NULL,
	[ANX_D_INCLUSAO] [datetime] NOT NULL,
	[ANX_N_ATIVO] [bit] NOT NULL,
	[ANX_B_OCULTO] [bit] NOT NULL,
	[ANX_ISP_N_ID] [int] NULL,
 CONSTRAINT [PK_WANX_ANEXO_ITEM] PRIMARY KEY CLUSTERED 
(
	[ANX_N_CODIGO] ASC
))

GO
CREATE TABLE [WATS_ATIVIDADE_SAIDA](
	[ATS_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ATS_N_ATV_N_CODIGO] [int] NOT NULL,
	[ATS_C_TITULO] [varchar](200) NOT NULL,
	[ATS_C_VALOR] [varchar](30) NOT NULL,
	[ATS_C_IDENTIFIER] [varchar](36) NOT NULL CONSTRAINT [DF_WATS_C_IDENTIFIER]  DEFAULT (newid()),
 CONSTRAINT [PK_WATS_ATIVIDADE_SAIDA] PRIMARY KEY CLUSTERED 
(
	[ATS_N_CODIGO] ASC
))

GO
CREATE TABLE [WATV_ATIVIDADE](
	[ATV_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ATV_N_PART_ID] [int] NOT NULL,
	[ATV_N_PRO_N_CODIGO] [int] NOT NULL,
	[ATV_N_MOD_N_CODIGO] [int] NOT NULL,
	[ATV_C_NOME] [varchar](100) NULL,
	[ATV_C_CONFIGURATION] [text] NULL,
	[ATV_C_IDENTIFIER] [varchar](36) NOT NULL CONSTRAINT [DF_ATV_C_IDENTIFIER]  DEFAULT (newid()),
 CONSTRAINT [PK_WATV_ATIVIDADE] PRIMARY KEY CLUSTERED 
(
	[ATV_N_CODIGO] ASC
))

GO
CREATE TABLE [WATX_ATIVIDADE_ANEXO](
	[ATX_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ATX_ATV_N_CODIGO] [int] NOT NULL,
	[ATX_C_NOME] [varchar](200) NOT NULL,
	[ATX_C_FORMATOANEXO] [varchar](max) NULL,
	[ATX_C_ALIASANEXO] [varchar](200) NULL,
	[ATX_N_TIPOANEXO] [int] NOT NULL,
 CONSTRAINT [PK_WATX_ATIVIDADE_ANEXO] PRIMARY KEY CLUSTERED 
(
	[ATX_N_CODIGO] ASC
))

GO
CREATE TABLE [WCCLI_CLASSIFIEDIMAGE](
	[CLI_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[CLI_CLS_N_ID] [int] NOT NULL,
	[CLI_C_IMAGE] [varchar](200) NOT NULL,
	[CLI_N_ORDER] [int] NOT NULL,
 CONSTRAINT [PK_WCCLI_CLASSIFIEDIMAGE] PRIMARY KEY CLUSTERED 
(
	[CLI_N_ID] ASC
))

GO
CREATE TABLE [WCCLS_CLASSIFIEDS](
	[CLS_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[CLS_N_CTT_N_ID] [int] NOT NULL,
	[CLS_C_TITLE] [varchar](80) NOT NULL,
	[CLS_C_DESCRIPTION] [varchar](max) NOT NULL,
	[CLS_C_USERNAME] [varchar](50) NOT NULL,
	[CLS_C_USEREMAIL] [varchar](150) NULL,
	[CLS_C_USERPHONE] [varchar](50) NULL,
	[CLS_D_PUBLISHDATE] [datetime] NOT NULL,
	[CLS_C_IMAGE] [varchar](200) NOT NULL,
	[CLS_C_THUMBNAIL] [varchar](200) NOT NULL,
	[CLS_C_PRICE] [float] NOT NULL,
 CONSTRAINT [PK_WCCLS_CLASSIFIEDS] PRIMARY KEY CLUSTERED 
(
	[CLS_N_ID] ASC
))

GO
CREATE TABLE [WCDIV_DIVIDER](
	[DIV_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[DIV_N_CTT_N_ID] [int] NOT NULL,
	[DIV_C_WIDTH] [varchar](10) NOT NULL,
	[DIV_N_ORDER] [int] NOT NULL,
	[DIV_C_DIVNAME] [varchar](50) NULL,
	[DIV_B_HASCONTENT] [bit] NOT NULL,
 CONSTRAINT [PK_WCDIV_DIVIDER] PRIMARY KEY CLUSTERED 
(
	[DIV_N_ID] ASC
))

GO
CREATE TABLE [WCEVE_EVENT](
	[EVE_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[EVE_N_CTT_N_ID] [int] NOT NULL,
	[EVE_C_TITLE] [nvarchar](80) NOT NULL,
	[EVE_D_BEGINDATE] [datetime] NOT NULL,
	[EVE_D_ENDDATE] [datetime] NULL,
	[EVE_C_DESCRIPTION] [nvarchar](200) NULL,
	[EVE_C_LOCAL] [nvarchar](50) NULL,
	[EVE_C_IMAGE] [nvarchar](100) NULL,
 CONSTRAINT [PK_WCEVE_EVENT] PRIMARY KEY CLUSTERED 
(
	[EVE_N_ID] ASC
))

GO
CREATE TABLE [WCFDB_FEEDBACK](
	[FDB_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[FDB_N_CTT_N_ID] [int] NOT NULL,
	[FDB_C_SUBJECT] [varchar](100) NOT NULL,
	[FDB_C_EMAIL] [varchar](200) NOT NULL,
 CONSTRAINT [PK_WCFDB_FEEDBACK] PRIMARY KEY CLUSTERED 
(
	[FDB_N_ID] ASC
))

GO
CREATE TABLE [WCFIL_FILE](
	[FIL_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[FIL_N_CTT_N_ID] [int] NOT NULL,
	[FIL_C_CREATOR] [varchar](100) NOT NULL,
	[FIL_D_CREATIONDATE] [datetime] NOT NULL,
	[FIL_C_FILENAME] [varchar](200) NOT NULL,
	[FIL_C_TITLE] [varchar](80) NOT NULL,
	[FIL_C_DESCRIPTION] [varchar](200) NOT NULL,
	[FIL_C_CATEGORY] [varchar](100) NOT NULL,
	[FIL_C_FREE1] [varchar](200) NOT NULL,
	[FIL_C_FREE2] [varchar](200) NOT NULL,
	[FIL_C_FREE3] [varchar](200) NOT NULL,
 CONSTRAINT [PK_WCFIL_FILE] PRIMARY KEY CLUSTERED 
(
	[FIL_N_ID] ASC
))

GO
CREATE TABLE [WCHEI_HEIR](
	[HEI_N_CTT_N_ID] [int] NOT NULL,
	[HEI_N_INHERITEDCTT] [int] NOT NULL,
 CONSTRAINT [PK_WCHEI_HEIR] PRIMARY KEY CLUSTERED 
(
	[HEI_N_CTT_N_ID] ASC
))

GO
CREATE TABLE [WCHTV_HTMLVIEW](
	[HTV_N_CTT_N_ID] [int] NOT NULL,
	[HTV_C_CONTENT] [text] NOT NULL,
 CONSTRAINT [PK_WCHTV_HTMLVIEW] PRIMARY KEY CLUSTERED 
(
	[HTV_N_CTT_N_ID] ASC
))

GO
CREATE TABLE [WCPBK_PHONEBOOK](
	[PBK_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[PBK_N_CTT_N_ID] [int] NOT NULL,
	[PBK_C_NAME] [varchar](100) NOT NULL,
	[PBK_C_AREA] [varchar](25) NULL,
	[PBK_C_PHONERES] [varchar](30) NULL,
	[PBK_C_PHONEBUS] [varchar](30) NULL,
	[PBK_C_MOBILE] [varchar](30) NULL,
	[PBK_C_EMAIL] [varchar](200) NULL,
	[PBK_C_JOBTITLE] [varchar](100) NULL,
	[PBK_C_CATEGORY] [varchar](30) NULL,
	[PBK_C_EXTENTION] [varchar](8) NULL,
	[PBK_C_ADDRESS] [varchar](250) NULL,
	[PBK_C_NEIGHBORHOOD] [varchar](50) NULL,
	[PBK_C_CITY] [varchar](50) NULL,
	[PBK_C_STATE] [varchar](4) NULL,
	[PBK_C_ZIP] [varchar](50) NULL,
	[PBK_C_FREE1] [varchar](200) NULL,
	[PBK_C_FREE2] [varchar](200) NULL,
 CONSTRAINT [PK_WCPBK_PHONEBOOK] PRIMARY KEY CLUSTERED 
(
	[PBK_N_ID] ASC
))

GO
CREATE TABLE [WCPLA_POLL_ANSWER](
	[PLA_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[PLA_N_PLL_N_ID] [int] NOT NULL,
	[PLA_C_ANSWER] [varchar](200) NOT NULL,
	[PLA_C_IMAGE] [varchar](200) NOT NULL,
	[PLA_C_ALTTEXT] [varchar](50) NOT NULL,
	[PLA_N_VOTES] [int] NOT NULL,
	[PLA_C_MESSAGE] [varchar](200) NOT NULL,
 CONSTRAINT [PK_WCPLA_POLL_ANSWER] PRIMARY KEY CLUSTERED 
(
	[PLA_N_ID] ASC
))

GO
CREATE TABLE [WCPLC_POLL_CONTENT](
	[PLC_N_CTT_N_ID] [int] NOT NULL,
	[PLC_N_PLL_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_WCPLC_POLL_CONTENT] PRIMARY KEY CLUSTERED 
(
	[PLC_N_CTT_N_ID] ASC
))

GO
CREATE TABLE [WCPLL_POLL](
	[PLL_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[PLL_N_ARE_N_ID] [int] NOT NULL,
	[PLL_C_QUESTION] [varchar](200) NOT NULL,
	[PLL_C_MESSAGE] [varchar](200) NOT NULL,
	[PLL_C_IMAGE] [varchar](200) NOT NULL,
	[PLL_C_ALTTEXT] [varchar](50) NOT NULL,
	[PLL_N_GRAPHTYPE] [smallint] NOT NULL,
	[PLL_N_UNIQUE] [bit] NOT NULL,
	[PLL_N_COLUMNS] [smallint] NOT NULL,
	[PLL_N_PUBLISHED] [bit] NOT NULL,
	[PLL_N_GRAPHHEIGHT] [int] NOT NULL,
	[PLL_N_GRAPHWIDTH] [int] NOT NULL,
	[PLL_C_VOTED] [text] NOT NULL,
 CONSTRAINT [PK_WCPLL_POLL] PRIMARY KEY CLUSTERED 
(
	[PLL_N_ID] ASC
))

GO
CREATE TABLE [WCPOP_POPUP](
	[POP_N_CTT_N_ID] [int] NOT NULL,
	[POP_C_WIDTH] [int] NOT NULL,
	[POP_C_HEIGHT] [int] NOT NULL,
	[POP_C_URL] [varchar](150) NOT NULL,
	[POP_D_START] [datetime] NULL,
	[POP_D_END] [datetime] NULL,
 CONSTRAINT [PK_WCPOP_POPUP] PRIMARY KEY CLUSTERED 
(
	[POP_N_CTT_N_ID] ASC
))

GO
CREATE TABLE [WCSUR_SENDURL](
	[SUR_N_CTT_N_ID] [int] NOT NULL,
	[SUR_C_IMAGE] [varchar](200) NOT NULL,
	[SUR_C_MESSAGE] [varchar](100) NOT NULL,
	[SUR_C_TEMPLATE] [text] NOT NULL,
 CONSTRAINT [PK_WCSUR_SENDURL] PRIMARY KEY CLUSTERED 
(
	[SUR_N_CTT_N_ID] ASC
))

GO
CREATE TABLE [WCWIN_WINDOW](
	[WIN_N_CTT_N_ID] [int] NOT NULL,
	[WIN_C_URL] [varchar](200) NOT NULL,
	[WIN_C_DESCRIPTION] [varchar](80) NOT NULL,
	[WIN_C_WIDTH] [varchar](5) NOT NULL,
	[WIN_C_HEIGHT] [varchar](5) NOT NULL,
	[WIN_C_USERNAME] [varchar](100) NOT NULL,
	[WIN_C_USERLOGIN] [varchar](100) NOT NULL,
	[WIN_C_USEREMAIL] [varchar](100) NOT NULL,
 CONSTRAINT [PK_WCWIN_WINDOW] PRIMARY KEY CLUSTERED 
(
	[WIN_N_CTT_N_ID] ASC
))

GO
CREATE TABLE [WDEC_DECISAO](
	[DEC_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[DEC_N_PART_ID] [int] NOT NULL,
	[DEC_N_ETA_N_CODIGO] [int] NOT NULL,
	[DEC_C_NOME] [varchar](30) NOT NULL,
	[DEC_C_STATUS] [varchar](50) NOT NULL,
	[DEC_N_QTD_USERS] [smallint] NOT NULL CONSTRAINT [DF_WDEC_DECISAO_DEC_N_QTD_USERS]  DEFAULT ((1)),
	[DEC_N_ASSINAR] [bit] NOT NULL CONSTRAINT [DF_WDEC_DECISAO_DEC_N_ASSINAR]  DEFAULT ((0)),
	[DEC_N_ORDEM] [smallint] NOT NULL CONSTRAINT [DF_WDEC_DECISAO_DEC_N_ORDEM]  DEFAULT ((0)),
 CONSTRAINT [PK_WDEC_DECISAO] PRIMARY KEY CLUSTERED 
(
	[DEC_N_CODIGO] ASC
))

GO
CREATE TABLE [WEML_EMAIL](
	[EML_N_PRZ_N_CODIGO] [int] NOT NULL,
	[EML_C_TITULO] [varchar](500) NULL,
	[EML_C_DESTINATARIOS] [varchar](300) NOT NULL,
	[EML_C_DESTINATARIOSCOPIA] [varchar](max) NULL,
	[EML_C_DESTINATARIOSCOPIAOCULTA] [varchar](max) NULL,
	[EML_C_TEXTO] [text] NOT NULL,
	[EML_N_PLAINTEXT] [bit] NOT NULL,
 CONSTRAINT [PK_WEML_EMAIL] PRIMARY KEY CLUSTERED 
(
	[EML_N_PRZ_N_CODIGO] ASC
))

GO
CREATE TABLE [WETA_ETAPA_PROCESSO](
	[ETA_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ETA_N_PART_ID] [int] NOT NULL,
	[ETA_N_PRO_N_CODIGO] [int] NOT NULL,
	[ETA_C_NOME] [varchar](100) NULL,
	[ETA_C_GRUPOPERFIL] [varchar](200) NULL,
	[ETA_C_GESTORES] [varchar](100) NULL,
	[ETA_N_TIPOETAPA] [smallint] NOT NULL,
	[ETA_N_ATRIBUICAO] [bit] NOT NULL CONSTRAINT [DF_WETA_ETAPA_PROCESSO_ETA_N_ATRIBUICAO]  DEFAULT ((0)),
	[ETA_N_PERFILRESTRICAO] [int] NOT NULL,
	[ETA_N_GRPDELEGAVEL] [int] NOT NULL,
	[ETA_C_METADATA] [text] NULL,
	[ETA_C_MENSAGEM] [text] NULL,
 CONSTRAINT [PK_WETA_ETAPA_PROCESSO] PRIMARY KEY CLUSTERED 
(
	[ETA_N_CODIGO] ASC
))

GO
CREATE TABLE [WETC_ETAPA_CONDENSADOR](
	[ETC_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[ETC_N_ETA_N_CODIGO] [int] NULL,
	[ETC_N_NOD_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_WETC_ETAPA_CONDENSADOR] PRIMARY KEY CLUSTERED 
(
	[ETC_N_ID] ASC
))

GO
CREATE TABLE [WETE_ETAPA_ITEM_EDITORS](
	[ETE_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ETE_N_ETI_N_CODIGO] [int] NOT NULL,
	[ETE_N_USR_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_WFETU_ETAPA_ITEM_USER] PRIMARY KEY CLUSTERED 
(
	[ETE_N_CODIGO] ASC
))

GO
CREATE TABLE [WETI_ETAPA_ITEM](
	[ETI_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ETI_N_IPR_N_CODIGO] [int] NOT NULL,
	[ETI_N_ETA_N_CODIGO] [int] NOT NULL,
	[ETI_N_USU_VINCULADO] [int] NOT NULL,
	[ETI_C_LISTAEDICAO] [varchar](200) NULL,
	[ETI_C_GESTORES] [varchar](100) NULL,
	[ETI_N_USU_CRIADOR] [int] NOT NULL,
	[ETI_N_USERPRIORITY] [smallint] NOT NULL,
	[ETI_N_ENABLED] [bit] NOT NULL,
	[ETI_D_INICIO] [datetime] NOT NULL,
	[ETI_C_APELIDOETAPA] [varchar](150) NULL,
	[ETI_ISP_N_ID] [int] NULL,
	[ETI_N_ETS_N_CODIGO] [int] NULL,
	[ETI_D_DEADLINE] [datetime] NULL,
 CONSTRAINT [PK_WETI_ETAPA_ITEM] PRIMARY KEY CLUSTERED 
(
	[ETI_N_CODIGO] ASC
))

GO
CREATE TABLE [WETS_ETAPA_SLA](
	[ETS_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ETS_C_NOME] [varchar](30) NOT NULL,
	[ETS_C_COR] [char](7) NOT NULL,
	[ETS_N_ORDEM] [int] NULL,
	[ETS_N_ATRASO] [int] NULL,
	[ETS_B_ACTIVE] [bit] NOT NULL,
 CONSTRAINT [PK_WETS_ETAPA_SLA] PRIMARY KEY CLUSTERED 
(
	[ETS_N_CODIGO] ASC
))

GO
CREATE TABLE [WEVE_EVENTO](
	[EVE_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[EVE_N_PART_ID_LINK] [int] NOT NULL,
	[EVE_N_PRO_N_CODIGO] [int] NOT NULL,
	[EVE_N_ORIGEM_TIPO] [int] NOT NULL,
	[EVE_N_ORIGEM_ID] [int] NOT NULL,
	[EVE_N_SUCESSOR_TIPO] [int] NOT NULL,
	[EVE_N_SUCESSOR_ID] [int] NOT NULL,
	[EVE_C_STATUS] [varchar](50) NOT NULL,
 CONSTRAINT [PK_WEVE_EVENTO] PRIMARY KEY CLUSTERED 
(
	[EVE_N_CODIGO] ASC
))

GO
CREATE TABLE [WEVP_EVENTO_PENDENTE](
	[EVP_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[EVP_N_IPR_N_CODIGO] [int] NOT NULL,
	[EVP_N_TRIGGERID] [int] NOT NULL,
	[EVP_N_PENDINGID] [int] NOT NULL,
	[EVP_N_ETI_N_CODIGO] [int] NOT NULL,
	[EVP_N_ETA_N_CODIGO] [int] NOT NULL,
	[EVP_N_ORDER] [int] NULL,
	[EVP_N_ORIGINTYPE] [int] NULL,
	[EVP_N_ORIGINID] [int] NULL,
	[EVP_ISP_N_ID] [int] NULL,
 CONSTRAINT [PK_WEVP_EVENTO_PENDENTE] PRIMARY KEY CLUSTERED 
(
	[EVP_N_CODIGO] ASC
))

GO
CREATE TABLE [WFADX_AUDITEXCEPTION](
	[ADX_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[ADX_C_CATEGORY] [varchar](100) NOT NULL,
 CONSTRAINT [PK_WFADX_AUDITEXCEPTION] PRIMARY KEY CLUSTERED 
(
	[ADX_N_ID] ASC
))

GO
CREATE TABLE [WFAPF_APPROVAL_FLOW](
	[APF_N_PAG_N_ID] [int] NOT NULL,
	[APF_N_ARE_N_ID] [int] NOT NULL,
	[APF_N_ROL_N_ID] [int] NOT NULL,
	[APF_C_ROLENAME] [varchar](100) NOT NULL,
	[APF_N_COUNT] [int] NOT NULL,
	[APF_D_TIMESTAMP] [datetime] NOT NULL,
	[APF_C_USERNAME] [varchar](200) NOT NULL,
	[APF_C_APPROVALINFO] [text] NOT NULL,
 CONSTRAINT [PK_WFAPF_APPROVAL_FLOW_1] PRIMARY KEY CLUSTERED 
(
	[APF_N_PAG_N_ID] ASC
))

GO
CREATE TABLE [WFER_FERIADO](
	[FER_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[FER_N_DIA] [smallint] NOT NULL,
	[FER_N_MES] [smallint] NOT NULL,
	[FER_N_ANO] [smallint] NULL,
	[FER_N_LOC_ID] [nchar](10) NOT NULL,
 CONSTRAINT [PK_WFER_FERIADO] PRIMARY KEY CLUSTERED 
(
	[FER_N_CODIGO] ASC
))

GO
CREATE TABLE [WFESE_ESTATISTICA_ETAPA](
	[ESE_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[ESE_N_PRO_N_CODIGO] [int] NOT NULL,
	[ESE_N_IPR_N_CODIGO] [int] NOT NULL,
	[ESE_N_ETA_N_CODIGO] [int] NOT NULL,
	[ESE_D_INICIO] [datetime] NOT NULL,
	[ESE_D_FIM] [datetime] NOT NULL,
	[ESE_N_PRAZOFULL] [float] NOT NULL,
	[ESE_N_PRAZOREAL] [float] NOT NULL,
	[ESE_N_EXECID] [int] NULL,
	[ESE_C_EXECNAME] [varchar](80) NULL,
	[ESE_N_ETS_CODIGO] [int] NOT NULL,
 CONSTRAINT [PK_WFESE_ESTATISTICA_ETAPA] PRIMARY KEY CLUSTERED 
(
	[ESE_N_ID] ASC
))

GO
CREATE TABLE [WFESP_ESTATISTICA_PROCESSO](
	[ESP_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[ESP_N_PRO_N_CODIGO] [int] NOT NULL,
	[ESP_N_IPR_N_CODIGO] [int] NOT NULL,
	[ESP_D_INICIO] [datetime] NOT NULL,
	[ESP_D_FIM] [datetime] NOT NULL,
	[ESP_N_PRAZOFULL] [float] NOT NULL,
	[ESP_N_PRAZOREAL] [float] NOT NULL,
	[ESP_N_EXECID] [int] NOT NULL,
	[ESP_C_EXECNAME] [varchar](255) NULL,
	[ESP_N_ETS_CODIGO] [int] NOT NULL,
 CONSTRAINT [PK_WFESP_ESTATISTICA_PROCESSO] PRIMARY KEY CLUSTERED 
(
	[ESP_N_ID] ASC
))

GO
CREATE TABLE [WFFBK_FEEDBACKINFO](
	[FBK_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[FBK_C_NAME] [varchar](300) NULL,
	[FBK_C_EMAIL] [varchar](100) NULL,
	[FBK_C_MESSAGE] [varchar](500) NULL,
	[FBK_C_USERLOGIN] [varchar](100) NULL,
	[FBK_C_FREEFIELD1] [varchar](500) NULL,
	[FBK_C_FREEFIELD2] [varchar](500) NULL,
	[FBK_D_DISPATCHDATE] [datetime] NULL,
 CONSTRAINT [PK_WFFBK_FEEDBACKINFO] PRIMARY KEY CLUSTERED 
(
	[FBK_N_ID] ASC
))

GO
CREATE TABLE [WFIL_FILTRO](
	[FIL_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[FIL_N_PART_ID] [int] NOT NULL,
	[FIL_N_PRO_N_CODIGO] [int] NOT NULL,
	[FIL_C_NOME] [varchar](30) NOT NULL,
 CONSTRAINT [PK_WFIL_FILTRO] PRIMARY KEY CLUSTERED 
(
	[FIL_N_CODIGO] ASC
))

GO
CREATE TABLE [WFIT_FILTRO_ITEM](
	[FIT_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[FIT_N_FIL_N_CODIGO] [int] NOT NULL,
	[FIT_N_POR_ORIGEM] [int] NOT NULL,
	[FIT_N_ARE_ORIGEM] [int] NOT NULL,
	[FIT_C_FILTRO] [varchar](50) NOT NULL,
 CONSTRAINT [PK_WFIT_FILTRO_ITEM] PRIMARY KEY CLUSTERED 
(
	[FIT_N_CODIGO] ASC
))

GO
CREATE TABLE [WFLOC_LOCATION](
	[LOC_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[LOC_C_NAME] [varchar](50) NOT NULL,
	[LOC_N_TIMEZONE] [int] NOT NULL,
 CONSTRAINT [PK_WFLOC_LOCATION] PRIMARY KEY CLUSTERED 
(
	[LOC_N_ID] ASC
))

GO
CREATE TABLE [WFMBR_MEMBERSHIP](
	[MBR_N_USR_N_ID] [int] NOT NULL,
	[MBR_C_PASSWORD] [varchar](100) NOT NULL,
	[MBR_C_PWDQUESTION] [varchar](256) NULL,
	[MBR_C_PWDANSWER] [varchar](128) NULL,
	[MBR_B_ISAPPROVED] [bit] NOT NULL,
	[MBR_B_ISLOCKEDOUT] [bit] NOT NULL,
	[MBR_D_CREATEDATE] [datetime] NOT NULL,
	[MBR_D_LASTLOGINDATE] [datetime] NULL,
	[MBR_D_LASTACTIVITYDATE] [datetime] NULL,
	[MBR_D_LASTLOCKEDOUTDATE] [datetime] NULL,
	[MBR_D_LASTPWDCHANGE] [datetime] NULL,
	[MBR_N_FAILEDPWDCOUNT] [int] NOT NULL,
	[MBR_D_FAILEDPWD] [datetime] NULL,
	[MBR_N_FAILEDANSWERCOUNT] [int] NOT NULL,
	[MBR_D_FAILEDANSWER] [datetime] NULL,
	[MBR_C_PWDTYPE] [varchar](3) NOT NULL,
	[MBR_D_PWDEXPIRATION] [datetime] NULL,
 CONSTRAINT [PK_WFMBR_MEMBERSHIP] PRIMARY KEY CLUSTERED 
(
	[MBR_N_USR_N_ID] ASC
))

GO
CREATE TABLE [WFMEI_MENUITEM](
	[MEI_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[MEI_N_MEN_N_ID] [int] NOT NULL,
	[MEI_C_READERS] [varchar](200) NOT NULL,
	[MEI_C_NAME] [varchar](100) NOT NULL,
	[MEI_C_URL] [varchar](1000) NOT NULL,
	[MEI_C_TARGET] [varchar](20) NOT NULL,
	[MEI_C_HIERARCHY] [nvarchar](45) NOT NULL,
	[MEI_N_LOCALONLY] [bit] NOT NULL,
	[MEI_N_SYSTEMMENU] [bit] NOT NULL,
	[MEI_C_IMAGE] [varchar](100) NULL,
	[MEI_C_STATUSBAR] [varchar](150) NULL,
	[MEI_C_LANGUAGE] [varchar](5) NOT NULL,
	[MEI_C_NAMEKEY] [varchar](50) NULL,
	[MEI_C_CSSCLASS] [varchar](100) NULL,
 CONSTRAINT [PK_TMEN_MENUITEM] PRIMARY KEY CLUSTERED 
(
	[MEI_N_ID] ASC
))

GO
CREATE TABLE [WFMEN_MENU](
	[MEN_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[MEN_N_OWNER] [int] NOT NULL,
	[MEN_C_ALIAS] [varchar](50) NOT NULL,
	[MEN_C_EDITORS] [varchar](100) NOT NULL,
	[MEN_C_READERS] [varchar](200) NOT NULL,
	[MEN_C_LANGUAGES] [varchar](50) NOT NULL,
	[MEN_N_MST_N_ID] [int] NULL,
	[MEN_N_SYSTEMMENU] [bit] NOT NULL,
 CONSTRAINT [PK_WFMEN_MENU] PRIMARY KEY CLUSTERED 
(
	[MEN_N_ID] ASC
))

GO
CREATE TABLE [WFMET_MENUTRANSLATION](
	[MET_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[MET_C_LANGUAGE] [varchar](5) NOT NULL,
	[MET_C_NAMEKEY] [varchar](50) NOT NULL,
	[MET_C_MESSAGE] [varchar](300) NOT NULL,
 CONSTRAINT [PK_WFMET_MENUTRANSLATION] PRIMARY KEY CLUSTERED 
(
	[MET_N_ID] ASC
))

GO
CREATE TABLE [WFMPT_MENUPATTERN](
	[MPT_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[MPT_C_NAME] [nvarchar](20) NOT NULL,
	[MPT_N_TOP] [smallint] NULL,
	[MPT_N_LEFT] [smallint] NULL,
	[MPT_N_PADDING] [smallint] NULL,
	[MPT_N_WIDTH] [smallint] NULL,
	[MPT_N_HEIGHT] [smallint] NULL,
	[MPT_C_ORIENTATION] [nvarchar](19) NULL,
	[MPT_C_ALIGNMENT] [nvarchar](7) NULL,
	[MPT_C_TRANSITION] [nvarchar](120) NULL,
	[MPT_C_OF_FNCOLOR] [nvarchar](11) NULL,
	[MPT_C_OF_BGCOLOR] [nvarchar](11) NULL,
	[MPT_C_OF_BDCOLOR] [nvarchar](11) NULL,
	[MPT_C_OF_BGIMAGE] [nvarchar](100) NULL,
	[MPT_C_ON_FNCOLOR] [nvarchar](11) NULL,
	[MPT_C_ON_BGCOLOR] [nvarchar](11) NULL,
	[MPT_C_ON_BDCOLOR] [nvarchar](11) NULL,
	[MPT_C_ON_BGIMAGE] [nvarchar](100) NULL,
	[MPT_C_BD_COLOR] [nvarchar](11) NULL,
	[MPT_N_BD_WIDTH] [smallint] NULL,
	[MPT_C_FNT_SIZE] [nvarchar](11) NULL,
	[MPT_C_FNT_STYLE] [nvarchar](11) NULL,
	[MPT_C_FNT_BOLD] [nvarchar](11) NULL,
	[MPT_C_FNT_NAME] [nvarchar](60) NULL,
	[MPT_C_FNT_DECORATION] [nvarchar](12) NULL,
	[MPT_C_SUBIMAGE] [nvarchar](100) NULL,
	[MPT_N_SUBIMAGEPADDING] [smallint] NULL,
	[MPT_C_SUBIMAGEPOSITION] [nvarchar](15) NULL,
	[MPT_C_SEPCOLOR] [nvarchar](11) NULL,
	[MPT_N_SEPSIZE] [smallint] NULL,
	[MPT_N_SEPPADDING] [smallint] NULL,
 CONSTRAINT [PK_TMPD_MENUPADRAO] PRIMARY KEY CLUSTERED 
(
	[MPT_N_ID] ASC
))

GO
CREATE TABLE [WFMSG_MESSAGE](
	[MSG_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[MSG_C_CATEGORY] [varchar](200) NOT NULL,
	[MSG_C_TITLE] [varchar](200) NOT NULL,
	[MSG_C_LINK] [varchar](300) NOT NULL,
	[MSG_C_MESSAGE] [text] NOT NULL,
	[MSG_C_PUBDATE] [datetime] NOT NULL,
	[MSG_C_READERS] [varchar](200) NOT NULL,
 CONSTRAINT [PK_WFMSG_MESSAGES] PRIMARY KEY CLUSTERED 
(
	[MSG_N_ID] ASC
))

GO
CREATE TABLE [WFMST_MENUSTYLE](
	[MST_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[MST_C_ALIAS] [varchar](50) NOT NULL,
	[MST_N_ROOTPATTERNID] [int] NOT NULL,
	[MST_N_SUBPATTERNID] [int] NOT NULL,
	[MST_N_SELPATTERNID] [int] NOT NULL,
	[MST_N_OPENONCLICK] [bit] NOT NULL,
 CONSTRAINT [PK_TMST_MENUESTILO] PRIMARY KEY CLUSTERED 
(
	[MST_N_ID] ASC
))

GO
CREATE TABLE [WFOWN_OWNER](
	[OWN_N_ID] [int] NOT NULL,
	[OWN_C_NAME] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_WFOWN_OWNER] PRIMARY KEY CLUSTERED 
(
	[OWN_N_ID] ASC
))

GO
CREATE TABLE [WFPRF_PROFILE](
	[PRF_N_USR_N_ID] [int] NOT NULL,
	[PRF_C_PROPERTYNAMES] [text] NOT NULL,
	[PRF_C_PROPERTYVALUES] [text] NOT NULL,
	[PRF_D_LASTUPDATE] [datetime] NOT NULL,
 CONSTRAINT [PK_WFPRF_PROFILE_1] PRIMARY KEY CLUSTERED 
(
	[PRF_N_USR_N_ID] ASC
))

GO
CREATE TABLE [WFRGP_ROLE_GROUP](
	[RGP_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[RGP_C_GUID] [uniqueidentifier] NOT NULL,
	[RGP_C_NAME] [varchar](50) NOT NULL,
	[RGP_N_OWNER] [int] NOT NULL,
	[RGP_B_ENABLED] [bit] NOT NULL,
 CONSTRAINT [PK_WFRGR_ROLE_GROUP] PRIMARY KEY CLUSTERED 
(
	[RGP_N_ID] ASC
))

GO
CREATE TABLE [WFRGR_ROLE_GROUP_ROLES](
	[RGR_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[RGR_N_ROL_N_ID] [int] NOT NULL,
	[RGR_N_RGR_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_WFRGM_ROLE_GROUP_MEMBERS] PRIMARY KEY CLUSTERED 
(
	[RGR_N_ID] ASC
))

GO
CREATE TABLE [WFRGU_ROLE_GROUP_USERS](
	[RGU_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[RGU_N_RGR_N_ID] [int] NOT NULL,
	[RGU_N_USR_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_WFRGU_ROLE_GROUP_USERS] PRIMARY KEY CLUSTERED 
(
	[RGU_N_ID] ASC
))

GO
CREATE TABLE [WFROL_ROLE](
	[ROL_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[ROL_C_GUID] [uniqueidentifier] NOT NULL,
	[ROL_C_NAME] [varchar](50) NOT NULL,
	[ROL_N_OWNER] [int] NOT NULL,
	[ROL_B_SYSTEMROLE] [bit] NOT NULL,
	[ROL_B_WINROLE] [bit] NOT NULL,
	[ROL_B_ENABLED] [bit] NOT NULL,
 CONSTRAINT [PK_WFROL_ROLE] PRIMARY KEY CLUSTERED 
(
	[ROL_N_ID] ASC
))

GO
CREATE TABLE [WFRUS_ROLE_USERS](
	[RUS_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[RUS_N_ROL_N_ID] [int] NOT NULL,
	[RUS_N_USR_N_ID] [int] NULL,
 CONSTRAINT [PK_WFRMB_ROLE_MEMBERS] PRIMARY KEY CLUSTERED 
(
	[RUS_N_ID] ASC
))

GO
CREATE TABLE [WFTHB_THUMBNAILS](
	[THB_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[THB_C_URL] [nvarchar](400) NOT NULL,
	[THB_C_FILENAME] [nvarchar](100) NOT NULL,
	[THB_D_EXPIRATION] [datetime] NOT NULL,
 CONSTRAINT [PK_WFTHB_THUMBNAILS] PRIMARY KEY CLUSTERED 
(
	[THB_N_ID] ASC
))

GO
CREATE TABLE [WFUSD_USERDEVICE](
	[USD_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[USD_USR_N_ID] [int] NOT NULL,
	[USD_C_DEVICENAME] [varchar](250) NULL,
	[USD_C_DEVICEPLATFORM] [varchar](20) NULL,
	[USD_C_VERSION] [varchar](20) NOT NULL,
	[USD_N_DEVICETYPE] [int] NOT NULL,
	[USD_C_DEVICETOKEN] [varchar](500) NOT NULL,
	[USD_N_STATUS] [int] NOT NULL,
	[USD_D_REGISTERED] [datetime] NOT NULL,
	[USD_D_LASTACCESS] [datetime] NOT NULL,
	[USD_D_STATUSCHANGED] [datetime] NOT NULL,
 CONSTRAINT [PK_WFUSD] PRIMARY KEY CLUSTERED 
(
	[USD_N_ID] ASC
))

GO
CREATE TABLE [WFUSR_USER](
	[USR_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[USR_C_GUID] [uniqueidentifier] NOT NULL,
	[USR_C_LOGIN] [varchar](120) NOT NULL,
	[USR_C_WINLOGON] [varchar](120) NOT NULL,
	[USR_C_FULLNAME] [varchar](200) NOT NULL,
	[USR_C_EMAIL] [varchar](250) NOT NULL,
	[USR_C_IMAGE1] [varchar](80) NULL,
	[USR_C_IMAGE2] [varchar](80) NULL,
	[USR_C_COMPANY] [varchar](80) NULL,
	[USR_N_OWNER] [int] NOT NULL,
	[USR_N_LOCATION] [int] NULL,
	[USR_B_SYSTEMUSER] [bit] NOT NULL,
	[USR_B_WINUSER] [bit] NOT NULL,
	[USR_D_BIRTHDATE] [datetime] NULL,
 CONSTRAINT [PK_WFUSR_USER] PRIMARY KEY CLUSTERED 
(
	[USR_N_ID] ASC
))

GO
CREATE TABLE [WHIF_HISTORICO_ARQUIVADO](
	[HIF_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[HIF_N_PRO_N_CODIGO] [int] NOT NULL,
	[HIF_N_IWF_N_CODIGO] [int] NOT NULL,
	[HIF_N_USR_EXECUTOR] [int] NOT NULL,
	[HIF_N_ETA_N_CODIGO] [int] NOT NULL,
	[HIF_N_ETI_N_CODIGO] [int] NOT NULL,
	[HIF_C_STATUS] [varchar](30) NOT NULL,
	[HIF_D_GRAVACAO] [datetime] NOT NULL,
	[HIF_C_DESCRICAO] [varchar](250) NOT NULL,
	[HIF_N_ACAOID] [int] NOT NULL,
	[HIF_N_TIPOACAO] [int] NOT NULL,
	[HIF_N_EVE_N_ID] [int] NOT NULL,
	[HIF_N_ATIVO] [bit] NOT NULL,
	[HIF_ISP_N_ID] [varchar](500) NULL,
	[HIF_C_IDENTIFICADOR] [varchar](500) NULL,
 CONSTRAINT [PK_HISTORICO_ARQUIVADO] PRIMARY KEY CLUSTERED 
(
	[HIF_N_CODIGO] ASC
))

GO
CREATE TABLE [WHIF_HISTORICO_FINALIZADO](
	[HIF_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[HIF_N_PRO_N_CODIGO] [int] NOT NULL,
	[HIF_N_IWF_N_CODIGO] [int] NOT NULL,
	[HIF_N_USR_EXECUTOR] [int] NOT NULL,
	[HIF_N_ETA_N_CODIGO] [int] NOT NULL,
	[HIF_N_ETI_N_CODIGO] [int] NOT NULL,
	[HIF_C_STATUS] [varchar](30) NOT NULL,
	[HIF_D_GRAVACAO] [datetime] NOT NULL,
	[HIF_C_DESCRICAO] [varchar](250) NOT NULL,
	[HIF_N_ACAOID] [int] NOT NULL,
	[HIF_N_TIPOACAO] [int] NOT NULL,
	[HIF_N_EVE_N_ID] [int] NOT NULL,
	[HIF_N_ATIVO] [bit] NOT NULL,
	[HIF_ISP_N_ID] [int] NULL,
	[HIF_N_LOGLEVEL] [int] NOT NULL,
	[HIF_C_IDENTIFICADOR] [varchar](500) NULL,
 CONSTRAINT [PK_WHIF_HISTORICO_FINALIZADO] PRIMARY KEY CLUSTERED 
(
	[HIF_N_CODIGO] ASC
))

GO
CREATE TABLE [WHIS_HISTORICO_ITEM](
	[HIS_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[HIS_N_PRO_N_CODIGO] [int] NOT NULL,
	[HIS_N_IWF_N_CODIGO] [int] NOT NULL,
	[HIS_N_USR_EXECUTOR] [int] NOT NULL,
	[HIS_N_ETA_N_CODIGO] [int] NOT NULL,
	[HIS_N_ETI_N_CODIGO] [int] NOT NULL,
	[HIS_C_STATUS] [varchar](30) NOT NULL,
	[HIS_D_GRAVACAO] [datetime] NOT NULL,
	[HIS_C_DESCRICAO] [varchar](250) NOT NULL,
	[HIS_N_ACAOID] [int] NOT NULL,
	[HIS_N_TIPOACAO] [int] NOT NULL,
	[HIS_N_EVE_N_ID] [int] NOT NULL,
	[HIS_N_ATIVO] [bit] NOT NULL,
	[HIS_ISP_N_ID] [int] NULL,
	[HIS_N_LOGLEVEL] [int] NOT NULL,
 CONSTRAINT [PK_WHIS_HISTORICO_ITEM] PRIMARY KEY CLUSTERED 
(
	[HIS_N_CODIGO] ASC
))

GO
CREATE TABLE [WIEX_ITEM_EXECUCAO](
	[IEX_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[IEX_N_IPR_N_CODIGO] [int] NOT NULL,
	[IEX_N_USR_N_ID] [int] NOT NULL,
	[IEX_N_ETI_N_CODIGO] [int] NOT NULL,
	[IEX_N_ETA_N_CODIGO] [int] NOT NULL,
	[IEX_D_EXECUCAO] [datetime] NOT NULL,
	[IEX_N_ACAOID] [int] NOT NULL,
	[IEX_N_TIPOACAO] [int] NOT NULL,
	[IEX_N_EVE_N_ID] [int] NOT NULL,
	[IEX_C_RETURN] [varchar](50) NULL,
	[IEX_ISP_N_ID] [int] NULL,
 CONSTRAINT [PK_WIEX_ITEM_EXECUCAO] PRIMARY KEY CLUSTERED 
(
	[IEX_N_CODIGO] ASC
))

GO
CREATE TABLE [WIMG_ITEM_MESSAGE](
	[IMG_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[IMG_IPR_N_CODIGO] [int] NULL,
	[IMG_C_SUBJECT] [varchar](50) NOT NULL,
	[IMG_C_MESSAGE] [varchar](max) NOT NULL,
	[IMG_N_SENDER] [int] NOT NULL,
	[IMG_C_SENDERSTEP] [varchar](50) NOT NULL,
	[IMG_C_RECIPIENT] [varchar](150) NOT NULL,
	[IMG_C_CARBONCOPY] [varchar](150) NOT NULL,
	[IMG_D_DATECREATED] [datetime] NOT NULL,
	[IMG_IMG_N_ID] [int] NULL DEFAULT ((0)),
	[IMG_PRO_N_CODIGO] [int] NOT NULL,
 CONSTRAINT [PK_WIMG_ITEM_MESSAGE] PRIMARY KEY CLUSTERED 
(
	[IMG_N_ID] ASC
))

GO
CREATE TABLE [WIMG_ITEM_MESSAGE_FINALIZADO](
	[IMG_IPR_N_CODIGO] [int] NULL,
	[IMG_C_SUBJECT] [varchar](50) NOT NULL,
	[IMG_C_MESSAGE] [varchar](max) NOT NULL,
	[IMG_N_SENDER] [int] NOT NULL,
	[IMG_C_SENDERSTEP] [varchar](50) NOT NULL,
	[IMG_C_RECIPIENT] [varchar](150) NOT NULL,
	[IMG_C_CARBONCOPY] [varchar](150) NOT NULL,
	[IMG_D_DATECREATED] [datetime] NOT NULL,
	[IMG_IMG_N_ID] [int] NULL,
	[IMG_PRO_N_CODIGO] [int] NOT NULL,
	[IMG_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_ITEMMSG_FINALIZADO] PRIMARY KEY CLUSTERED 
(
	[IMG_N_ID] ASC
))

GO
CREATE TABLE [WIMI_ITEM_METAINFO](
	[IMI_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[IMI_N_PROCESSID] [int] NOT NULL,
	[IMI_C_IDENTIFIER] [varchar](50) NOT NULL,
	[IMI_C_FIELDNAME] [varchar](250) NOT NULL,
 CONSTRAINT [PK_WIMI_ITEM_METAINFO] PRIMARY KEY CLUSTERED 
(
	[IMI_N_CODIGO] ASC
))

GO
CREATE TABLE [WIMR_ITEM_MESSAGE_READERS](
	[IMR_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[IMR_USR_N_ID] [int] NOT NULL,
	[IMR_IMG_N_ID] [int] NOT NULL,
	[IMR_B_ISRECIPIENT] [bit] NOT NULL,
	[IMR_B_READ] [bit] NOT NULL,
	[IMR_B_LIKED] [bit] NOT NULL,
	[IMR_B_FLAGGED] [bit] NOT NULL,
 CONSTRAINT [PK_WIMR_ITEM_MESSAGE_READERS] PRIMARY KEY CLUSTERED 
(
	[IMR_N_ID] ASC
))

GO
CREATE TABLE [WIMR_ITEM_MSG_RDRS_FIM](
	[IMR_USR_N_ID] [int] NOT NULL,
	[IMR_IMG_N_ID] [int] NOT NULL,
	[IMR_B_ISRECIPIENT] [bit] NOT NULL,
	[IMR_B_READ] [bit] NOT NULL,
	[IMR_B_LIKED] [bit] NOT NULL,
	[IMR_B_FLAGGED] [bit] NOT NULL,
	[IMR_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_ITEMMSG_READERS_FINALIZADO] PRIMARY KEY CLUSTERED 
(
	[IMR_N_ID] ASC
))

GO
CREATE TABLE [WIPR_ITEM_PROCESSO](
	[IPR_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[IPR_N_IWF_N_CODIGO] [int] NOT NULL,
	[IPR_N_PRO_N_CODIGO] [int] NOT NULL,
	[IPR_N_COUNTERID] [int] NOT NULL,
	[IPR_N_PRIORIDADE] [int] NOT NULL,
	[IPR_D_DATAINICIO] [datetime] NOT NULL,
	[IPR_C_STATUSCOLOR] [varchar](10) NOT NULL,
	[IPR_N_FINALIZADO] [bit] NOT NULL,
	[IPR_C_LISTAACESSO] [varchar](100) NULL,
	[IPR_N_LOCALIDADE] [int] NOT NULL,
	[IPR_C_METADATA] [text] NULL,
	[IPR_D_SLAFINAL] [datetime] NULL,
	[IPR_N_CURRENTSLA] [int] NULL,
 CONSTRAINT [PK_WIPR_ITEM_PROCESSO] PRIMARY KEY CLUSTERED 
(
	[IPR_N_CODIGO] ASC
))

GO
CREATE TABLE [WIPR_ITEM_PROCESSO_FINALIZADO](
	[IPR_N_CODIGO] [int] NOT NULL,
	[IPR_N_IWF_N_CODIGO] [int] NOT NULL,
	[IPR_N_PRO_N_CODIGO] [int] NOT NULL,
	[IPR_N_COUNTERID] [int] NOT NULL,
	[IPR_N_PRIORIDADE] [int] NOT NULL,
	[IPR_D_DATAINICIO] [datetime] NOT NULL,
	[IPR_C_STATUSCOLOR] [varchar](10) NOT NULL,
	[IPR_N_FINALIZADO] [bit] NOT NULL,
	[IPR_C_LISTAACESSO] [varchar](100) NULL,
	[IPR_N_LOCALIDADE] [int] NOT NULL,
	[IPR_C_METADATA] [text] NULL,
	[IPR_D_SLAFINAL] [datetime] NULL,
	[IPR_N_CURRENTSLA] [int] NOT NULL,
 CONSTRAINT [PK_ITEMPROCESSO_FINALIZADO] PRIMARY KEY CLUSTERED 
(
	[IPR_N_CODIGO] ASC
))

GO
CREATE TABLE [WIRF_ITEM_READERS_FINALIZADO](
	[IRF_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[IRF_N_IPR_N_CODIGO] [int] NOT NULL,
	[IRF_N_USR_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_WIRF_ITEM_READERS_FINALIZADO] PRIMARY KEY CLUSTERED 
(
	[IRF_N_CODIGO] ASC
))

GO
CREATE TABLE [WISP_ITEM_SUBPROCESS](
	[ISP_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[ISP_N_IPR_N_CODIGO] [int] NOT NULL,
	[ISP_N_PARENTISP_ID] [int] NOT NULL,
	[ISP_ATV_N_CODIGO] [int] NOT NULL,
	[ISP_C_IDENTIFIER] [varchar](300) NULL,
	[ISP_C_TITLE] [varchar](200) NULL,
	[ISP_C_METADATA] [varchar](max) NULL,
	[ISP_N_LOOPITEM] [int] NULL,
	[ISP_NOD_C_SCOPE] [varchar](36) NULL,
 CONSTRAINT [PK_WISP_ITEM_SUBPROCESS] PRIMARY KEY CLUSTERED 
(
	[ISP_N_ID] ASC
))

GO
CREATE TABLE [WISP_ITEM_SUBPROCESS_FINALIZADO](
	[ISP_N_ID] [int] NOT NULL,
	[ISP_N_IPR_N_CODIGO] [int] NOT NULL,
	[ISP_N_PARENTISP_ID] [int] NOT NULL,
	[ISP_ATV_N_CODIGO] [int] NOT NULL,
	[ISP_C_IDENTIFIER] [varchar](300) NULL,
	[ISP_C_TITLE] [varchar](200) NULL,
	[ISP_C_METADATA] [varchar](max) NULL,
	[ISP_N_LOOPITEM] [int] NULL,
	[ISP_NOD_C_SCOPE] [varchar](36) NULL,
 CONSTRAINT [PK_WISP_ITEM_SUBPROCESSFINAL] PRIMARY KEY CLUSTERED 
(
	[ISP_N_ID] ASC
))

GO
CREATE TABLE [WITA_ITEM_ACESSO](
	[ITA_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ITA_N_IPR_N_CODIGO] [int] NOT NULL,
	[ITA_N_ETA_N_CODIGO] [int] NOT NULL,
	[ITA_C_ACESSO] [varchar](100) NOT NULL,
	[ITA_ISP_N_ID] [int] NULL,
 CONSTRAINT [PK_WITA_ITEM_ACESSO] PRIMARY KEY CLUSTERED 
(
	[ITA_N_CODIGO] ASC
))

GO
CREATE TABLE [WITA_ITEM_ARQUIVADO](
	[ITA_N_CODIGO] [int] NOT NULL,
	[ITA_C_NOME] [varchar](80) NOT NULL,
	[ITA_C_STATUS] [varchar](50) NOT NULL,
	[ITA_D_DATAINICIO] [datetime] NOT NULL,
	[ITA_N_USU_OWNER] [int] NOT NULL,
	[ITA_C_LISTAACESSO] [varchar](100) NOT NULL,
	[ITA_N_ARE_ORIGEM] [int] NOT NULL,
	[ITA_N_FINALIZADO] [bit] NOT NULL,
	[ITA_C_PROCESSOS] [text] NOT NULL,
	[ITA_D_DATAFIM] [datetime] NULL,
 CONSTRAINT [PK_WITA_ITEM_ARQUIVADO] PRIMARY KEY CLUSTERED 
(
	[ITA_N_CODIGO] ASC
))

GO
CREATE TABLE [WITR_ITEM_READERS](
	[ITR_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ITR_N_IPR_N_CODIGO] [int] NOT NULL,
	[ITR_N_USR_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_WITR_ITEM_READERS] PRIMARY KEY CLUSTERED 
(
	[ITR_N_CODIGO] ASC
))

GO
CREATE TABLE [WITR_ITEM_RESTRICAO](
	[ITR_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ITR_N_IPR_N_CODIGO] [int] NOT NULL,
	[ITR_N_ACAOID] [int] NOT NULL,
	[ITR_N_ACAOTIPO] [int] NOT NULL,
	[ITR_C_RESTRICAO] [varchar](50) NOT NULL,
	[ITR_ISP_N_ID] [int] NULL,
 CONSTRAINT [PK_WITR_ITEM_RESTRICAO] PRIMARY KEY CLUSTERED 
(
	[ITR_N_CODIGO] ASC
))

GO
CREATE TABLE [WITX_ITEM_EXCLUSAO](
	[ITX_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[ITX_N_IPR_N_CODIGO] [int] NOT NULL,
	[ITX_N_ETA_N_CODIGO] [int] NOT NULL,
	[ITX_N_USERID] [int] NOT NULL,
	[ITX_ISP_N_ID] [int] NULL,
 CONSTRAINT [PK_WITA_ITEM_EXCLUSAO] PRIMARY KEY CLUSTERED 
(
	[ITX_N_CODIGO] ASC
))

GO
CREATE TABLE [WIVU_ITEM_USERS](
	[IVU_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[IVU_N_USR_N_ID] [int] NOT NULL,
	[IVU_N_IWF_N_CODIGO] [int] NOT NULL,
 CONSTRAINT [PK_WIVU_ITEM_USERS] PRIMARY KEY CLUSTERED 
(
	[IVU_N_CODIGO] ASC
))

GO
CREATE TABLE [WIWF_ITEM_WORKFLOW](
	[IWF_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[IWF_C_NOME] [varchar](80) NOT NULL,
	[IWF_C_STATUS] [varchar](50) NOT NULL,
	[IWF_D_DATAINICIO] [datetime] NOT NULL,
	[IWF_N_READONLY] [bit] NOT NULL,
	[IWF_N_USU_OWNER] [int] NOT NULL,
	[IWF_N_ARE_ORIGEM] [int] NOT NULL,
	[IWF_N_ITE_ORIGEM] [int] NOT NULL,
	[IWF_N_PRO_ORIGEM] [int] NOT NULL,
	[IWF_D_DATAFIM] [datetime] NULL,
	[IWF_C_PARAM1] [varchar](max) NULL,
	[IWF_C_PARAM2] [varchar](max) NULL,
	[IWF_C_PARAM3] [varchar](max) NULL,
	[IWF_C_PARAM4] [varchar](max) NULL,
	[IWF_C_PARAM5] [varchar](max) NULL,
	[IWF_C_METADATA] [varchar](max) NULL,
 CONSTRAINT [PK_WIWF_ITEM_WORKFLOW] PRIMARY KEY CLUSTERED 
(
	[IWF_N_CODIGO] ASC
))

GO
CREATE TABLE [WIWF_ITEM_WORKFLOW_FINALIZADO](
	[IWF_N_CODIGO] [int] NOT NULL,
	[IWF_C_NOME] [varchar](80) NOT NULL,
	[IWF_C_STATUS] [varchar](50) NOT NULL,
	[IWF_D_DATAINICIO] [datetime] NOT NULL,
	[IWF_N_READONLY] [bit] NOT NULL,
	[IWF_N_USU_OWNER] [int] NOT NULL,
	[IWF_N_ARE_ORIGEM] [int] NOT NULL,
	[IWF_N_ITE_ORIGEM] [int] NOT NULL,
	[IWF_N_PRO_ORIGEM] [int] NOT NULL,
	[IWF_D_DATAFIM] [datetime] NULL,
	[IWF_C_PARAM1] [varchar](max) NULL,
	[IWF_C_PARAM2] [varchar](max) NULL,
	[IWF_C_PARAM3] [varchar](max) NULL,
	[IWF_C_PARAM4] [varchar](max) NULL,
	[IWF_C_PARAM5] [varchar](max) NULL,
	[IWF_C_METADATA] [varchar](max) NULL,
 CONSTRAINT [PK_ITEMWORKFLOW_FINALIZADO] PRIMARY KEY CLUSTERED 
(
	[IWF_N_CODIGO] ASC
))

GO
CREATE TABLE [WLNK_LINK](
	[LNK_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[LNK_N_PRO_N_CODIGO] [int] NOT NULL,
	[LNK_N_PART_ID] [int] NOT NULL,
	[LNK_N_DIRECAO] [smallint] NOT NULL,
	[LNK_C_NOME] [varchar](30) NOT NULL,
	[LNK_N_PARENTID] [int] NOT NULL,
	[LNK_C_COR] [varchar](9) NULL,
	[LNK_NOD_C_IDENTIFIER] [varchar](36) NULL,
 CONSTRAINT [PK_WLNK_LINK] PRIMARY KEY CLUSTERED 
(
	[LNK_N_CODIGO] ASC
))

GO
CREATE TABLE [WMKR_MARKER](
	[MKR_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[MKR_NOD_N_ID] [int] NOT NULL,
	[MKR_C_NAME] [varchar](100) NOT NULL,
	[MKR_C_VALUE] [varchar](500) NOT NULL,
	[MKR_N_ITEMTYPE] [int] NOT NULL,
	[MKR_PRO_N_CODIGO] [int] NOT NULL,
	[MKR_N_ITEMID] [int] NOT NULL,
	[MKR_C_IDENTIFIER] [varchar](36) NULL,
	[MKR_D_CREATEDATE] [datetime] NOT NULL CONSTRAINT [DF_MKR_D_CREATEDATE]  DEFAULT (getdate()),
 CONSTRAINT [PK_WMKR_MARKER] PRIMARY KEY CLUSTERED 
(
	[MKR_N_CODIGO] ASC
))

GO
CREATE TABLE [WMOD_MODULO](
	[MOD_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[MOD_C_OWNERID] [uniqueidentifier] NULL,
	[MOD_C_ITEMID] [uniqueidentifier] NOT NULL CONSTRAINT [DF_WMOD_MODULO_MOD_C_ITEMID]  DEFAULT (newid()),
	[MOD_C_TITULO] [varchar](40) NOT NULL,
	[MOD_C_ASCX] [varchar](100) NOT NULL,
	[MOD_C_ASPXADM] [varchar](100) NOT NULL,
	[MOD_N_POPADM_HEIGHT] [smallint] NOT NULL,
	[MOD_N_POPADM_WIDTH] [smallint] NOT NULL,
	[MOD_N_TIPOSUCESSOR] [smallint] NOT NULL,
	[MOD_C_GUIDSUCESSOR] [varchar](36) NOT NULL,
	[MOD_N_TIPOANTECESSOR] [smallint] NOT NULL,
	[MOD_C_GUIDANTECESSOR] [varchar](36) NOT NULL,
	[MOD_C_ICONE] [varchar](150) NOT NULL,
	[MOD_C_CATEGORIA] [varchar](40) NOT NULL CONSTRAINT [DF_WMOD_MODULO_MOD_C_CATEGORIA]  DEFAULT (''),
	[MOD_N_TIPO_SAIDA] [smallint] NOT NULL,
	[MOD_N_TIPO_ENTRADA] [smallint] NOT NULL,
	[MOD_N_INTERATIVO] [bit] NOT NULL,
	[MOD_C_ASSEMBLYINFO] [varchar](500) NULL,
	[MOD_N_USODESENHO] [bit] NULL,
	[MOD_N_USOPRAZO] [bit] NULL,
	[MOD_N_ORDER] [smallint] NOT NULL CONSTRAINT [DF_MOD_N_ORDER]  DEFAULT ((0)),
 CONSTRAINT [PK_WMOD_MODULO] PRIMARY KEY CLUSTERED 
(
	[MOD_N_CODIGO] ASC
))

GO
CREATE TABLE [WMRS_MARKER_RESULT](
	[MRS_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[MRS_IWF_N_CODIGO] [int] NOT NULL,
	[MRS_IPR_N_CODIGO] [int] NOT NULL,
	[MRS_ISP_N_ID] [int] NOT NULL,
	[MRS_PRO_N_CODIGO] [int] NOT NULL,
	[MRS_N_USR_EXEC_ID] [int] NOT NULL,
	[MRS_D_EXEC_DATE] [datetime] NOT NULL,
	[MRS_MKR_C_NAME] [varchar](100) NOT NULL,
	[MRS_MKR_C_VALUE] [varchar](500) NOT NULL,
	[MRS_MKR_N_CODIGO] [int] NULL,
 CONSTRAINT [PK_WMRS_MARKER_RESULT] PRIMARY KEY CLUSTERED 
(
	[MRS_N_CODIGO] ASC
))

GO
CREATE TABLE [WMRS_MARKER_RESULT_FINISHED](
	[MRS_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[MRS_IWF_N_CODIGO] [int] NOT NULL,
	[MRS_IPR_N_CODIGO] [int] NOT NULL,
	[MRS_ISP_N_ID] [int] NOT NULL,
	[MRS_PRO_N_CODIGO] [int] NOT NULL,
	[MRS_N_USR_EXEC_ID] [int] NOT NULL,
	[MRS_D_EXEC_DATE] [datetime] NOT NULL,
	[MRS_MKR_C_NAME] [varchar](100) NOT NULL,
	[MRS_MKR_C_VALUE] [varchar](500) NOT NULL,
	[MRS_MKR_N_CODIGO] [int] NULL,
 CONSTRAINT [PK_WMRS_MKR_RES_FINISHED] PRIMARY KEY CLUSTERED 
(
	[MRS_N_CODIGO] ASC
))

GO
CREATE TABLE [WNOD_NODE](
	[NOD_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[NOD_PRO_N_CODIGO] [int] NOT NULL,
	[NOD_ATV_N_CODIGO] [int] NOT NULL,
	[NOD_C_TITLE] [varchar](200) NOT NULL,
	[NOD_MOD_C_ITEMID] [varchar](36) NOT NULL,
	[NOD_N_X] [int] NOT NULL,
	[NOD_N_Y] [int] NOT NULL,
	[NOD_B_HIDEGPS] [bit] NOT NULL DEFAULT ((0)),
	[NOD_C_DESCRIPTION] [varchar](2000) NULL,
	[NOD_B_CONFIGURED] [bit] NOT NULL DEFAULT ((0)),
	[NOD_B_MARKER] [bit] NULL,
	[NOD_D_CHANGE] [datetime] NOT NULL CONSTRAINT [DF_NOD_D_CHANGE]  DEFAULT (getutcdate()),
	[NOD_USR_N_ID] [int] NULL,
	[NOD_C_SCOPE] [varchar](36) NULL,
	[NOD_C_IDENTIFIER] [varchar](36) NOT NULL CONSTRAINT [DF_WNOD_NODE_IDENTIFIER]  DEFAULT (newid()),
 CONSTRAINT [PK_WNOD_NODE] PRIMARY KEY CLUSTERED 
(
	[NOD_N_ID] ASC
))

GO
CREATE TABLE [WNOL_NODELINK](
	[NOL_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[NOL_EVE_N_CODIGO] [int] NOT NULL,
	[NOL_ORIGIN_NOP_N_ID] [int] NOT NULL,
	[NOL_DESTINATION_NOP_N_ID] [int] NOT NULL,
	[NOL_C_COLOR] [varchar](10) NULL,
	[NOL_C_TITLE] [varchar](200) NULL,
	[NOL_C_IDENTIFIER] [varchar](36) NOT NULL CONSTRAINT [DF_WNOL_NODELINK_IDENTIFIER]  DEFAULT (newid()),
 CONSTRAINT [PK_WNOL_NODELINK] PRIMARY KEY CLUSTERED 
(
	[NOL_N_ID] ASC
))

GO
CREATE TABLE [WNOP_NODEPORT](
	[NOP_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[NOP_NOD_N_ID] [int] NOT NULL,
	[NOP_C_TITLE] [varchar](200) NULL,
	[NOP_N_MAXLINKS] [int] NOT NULL,
	[NOP_B_INPUTPORT] [bit] NOT NULL,
	[NOP_ATS_N_CODIGO] [int] NOT NULL DEFAULT ((0)),
	[NOP_C_IDENTIFIER] [varchar](36) NOT NULL CONSTRAINT [DF_WNOP_NODEP_IDENTIFIER]  DEFAULT (newid()),
 CONSTRAINT [PK_WNOP_NODEPORT] PRIMARY KEY CLUSTERED 
(
	[NOP_N_ID] ASC
))

GO
CREATE TABLE [WOBS_OBSERVADOR](
	[OBS_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[OBS_N_PART_ID] [int] NOT NULL,
	[OBS_N_PRO_N_CODIGO] [int] NOT NULL,
	[OBS_C_NOME] [varchar](30) NOT NULL,
	[OBS_C_LISTAACESSO] [varchar](100) NOT NULL CONSTRAINT [DF_WOBS_OBSERVADOR_OBS_C_LISTAACESSO]  DEFAULT (''),
 CONSTRAINT [PK_WOBS_OBSERVADOR] PRIMARY KEY CLUSTERED 
(
	[OBS_N_CODIGO] ASC
))

GO
CREATE TABLE [WPAPC_APPROVAL_COMMENT](
	[APC_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[APC_N_PAG_N_ID] [int] NOT NULL,
	[APC_D_TIMESTAMP] [datetime] NOT NULL,
	[APC_C_COMMENT] [varchar](1000) NOT NULL,
	[APC_N_USERID] [int] NOT NULL,
	[APC_N_ACTIVE] [bit] NOT NULL,
 CONSTRAINT [PK_WPAPC_APPROVAL_COMMENT] PRIMARY KEY CLUSTERED 
(
	[APC_N_ID] ASC
))

GO
CREATE TABLE [WPAPG_APPROVAL_GROUPS](
	[APG_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[APG_N_ARE_N_ID] [int] NOT NULL,
	[APG_N_GRP_N_ID] [int] NOT NULL,
	[APG_N_QUANTITY] [int] NOT NULL,
	[APG_N_ORDER] [int] NOT NULL,
 CONSTRAINT [PK_WPAPG_APPROVAL_GROUPS] PRIMARY KEY CLUSTERED 
(
	[APG_N_ID] ASC
))

GO
CREATE TABLE [WPARE_AREA](
	[ARE_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[ARE_C_NAME] [nvarchar](50) NOT NULL,
	[ARE_C_ALIAS] [nvarchar](50) NOT NULL,
	[ARE_N_POR_N_ID] [int] NOT NULL,
	[ARE_N_ADMROLE] [int] NOT NULL,
	[ARE_C_FOLDER] [nvarchar](50) NOT NULL,
	[ARE_N_HOMEPAGE_ID] [int] NOT NULL,
	[ARE_C_READERS] [nvarchar](200) NOT NULL,
	[ARE_N_SYSTEMAREA] [bit] NOT NULL,
	[ARE_C_TEMPLATEFILE] [varchar](100) NOT NULL,
	[ARE_N_MEN_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_TARE_AREA] PRIMARY KEY CLUSTERED 
(
	[ARE_N_ID] ASC
))

GO
CREATE TABLE [WPCCF_CONTENT_CONFIG](
	[CCF_N_CTT_N_ID] [int] NOT NULL,
	[CCF_N_CNT_N_ID] [int] NOT NULL,
	[CCF_C_PAGEAREA] [varchar](50) NOT NULL,
	[CCF_C_PARENTAREA] [varchar](50) NOT NULL,
	[CCF_N_ORDER] [int] NOT NULL,
	[CCF_C_TITLE] [varchar](100) NOT NULL,
	[CCF_C_READERS] [varchar](200) NOT NULL,
	[CCF_C_EDITORS] [varchar](100) NOT NULL,
	[CCF_C_BORDERCOLOR] [varchar](7) NOT NULL,
	[CCF_C_BGCOLOR] [varchar](7) NOT NULL,
	[CCF_C_STARTDATE] [datetime] NULL,
	[CCF_C_ENDDATE] [datetime] NULL,
	[CCF_N_BYPASSAPPROVAL] [bit] NOT NULL,
	[CCF_N_CHANGED] [bit] NOT NULL,
	[CCF_N_LOCALONLY] [bit] NOT NULL,
	[CCF_N_DELETENEXTPUBLISH] [bit] NOT NULL,
	[CCF_N_SHOWINPRINTMODE] [bit] NOT NULL,
	[CCF_C_HEIGHT] [varchar](10) NOT NULL,
	[CCF_C_WIDTH] [varchar](10) NOT NULL,
	[CCF_N_COLLAPSED] [bit] NOT NULL,
	[CCF_C_METAVALUES] [text] NOT NULL,
	[CCF_C_INDEX] [varchar](1000) NULL,
	[CCF_C_CONTENT_METADATA] [varchar](max) NULL,
 CONSTRAINT [PK_WFCCF_CONTENT_CONFIG] PRIMARY KEY CLUSTERED 
(
	[CCF_N_CTT_N_ID] ASC
))

GO
CREATE TABLE [WPCNT_CONTAINER](
	[CNT_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[CNT_C_TITLE] [varchar](50) NOT NULL,
	[CNT_C_FILENAME] [varchar](100) NOT NULL,
 CONSTRAINT [PK_WPCNT_CONTAINER] PRIMARY KEY CLUSTERED 
(
	[CNT_N_ID] ASC
))

GO
CREATE TABLE [WPCTT_CONTENT](
	[CTT_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[CTT_N_MOD_N_ID] [int] NOT NULL,
	[CTT_N_PAG_N_ID] [int] NOT NULL,
	[CTT_N_PUBLISHED] [bit] NOT NULL,
 CONSTRAINT [PK_WFCNT_CONTENT] PRIMARY KEY CLUSTERED 
(
	[CTT_N_ID] ASC
))

GO
CREATE TABLE [WPDP_PROCESSO_DEPENDENCIAS](
	[PDP_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[PDP_N_PROCESSO_N_ID] [int] NOT NULL,
	[PDP_N_ID_DEPENDENTE] [int] NOT NULL,
	[PDP_N_TIPO_DEPENDENTE] [int] NOT NULL,
	[PDP_C_ALIAS] [varchar](50) NOT NULL,
	[PDP_C_ID_ETAPA] [int] NOT NULL,
	[PDP_C_ID_ATIVIDADE] [int] NOT NULL,
 CONSTRAINT [PK_WPDP_PROCESSO_DEPENDENCIAS] PRIMARY KEY CLUSTERED 
(
	[PDP_N_CODIGO] ASC
))

GO
CREATE TABLE [WPEN_PONTO_ENTRADA](
	[PEN_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[PEN_N_PART_ID] [int] NOT NULL,
	[PEN_N_PRO_N_CODIGO] [int] NOT NULL,
	[PEN_C_NOME] [varchar](30) NOT NULL,
	[PEN_C_STATUS] [varchar](50) NOT NULL,
	[PEN_N_ETA_N_CODIGO] [int] NOT NULL CONSTRAINT [DF_WPEN_PONTO_ENTRADA_PEN_N_ETA_N_CODIGO]  DEFAULT ((-1)),
	[PEN_C_IDENTIFIER] [varchar](36) NOT NULL CONSTRAINT [DF_PEN_C_IDENTIFIER]  DEFAULT (newid()),
 CONSTRAINT [PK_WPEN_PONTO_ENTRADA] PRIMARY KEY CLUSTERED 
(
	[PEN_N_CODIGO] ASC
))

GO
CREATE TABLE [WPHFT_HEADERFOOTER](
	[HFT_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[HFT_N_OWNER] [int] NOT NULL,
	[HFT_C_ALIAS] [varchar](50) NOT NULL,
	[HFT_C_EDITORS] [varchar](100) NOT NULL,
	[HFT_N_PAG_N_ID] [int] NOT NULL,
 CONSTRAINT [PK_WPHFT_HEADERFOOTER] PRIMARY KEY CLUSTERED 
(
	[HFT_N_ID] ASC
))

GO
CREATE TABLE [WPHM_PUSH_MESSAGE](
	[PHM_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[PHM_ETI_N_ID] [int] NOT NULL,
	[PHM_USD_N_ID] [int] NOT NULL,
	[PHM_D_DATE_SEND] [datetime] NULL,
	[PHM_N_COUNT_RETRY] [int] NOT NULL,
	[PHM_C_MESSAGE] [varchar](4000) NULL,
 CONSTRAINT [PK_WPHM_PUSH_MESSAGE] PRIMARY KEY CLUSTERED 
(
	[PHM_N_ID] ASC
))

GO
CREATE TABLE [WPMOD_MODULE](
	[MOD_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[MOD_C_OWNER] [uniqueidentifier] NOT NULL,
	[MOD_C_GUID] [uniqueidentifier] NOT NULL,
	[MOD_C_NAME] [varchar](50) NOT NULL,
	[MOD_C_CATEGORY] [varchar](50) NOT NULL,
	[MOD_C_COMPONENT] [varchar](100) NOT NULL,
	[MOD_N_INTERACTIVE] [bit] NOT NULL,
	[MOD_N_LOCALONLY] [bit] NOT NULL,
 CONSTRAINT [PK_WFMOD_MODULE] PRIMARY KEY CLUSTERED 
(
	[MOD_N_ID] ASC
))

GO
CREATE TABLE [WPPAG_PAGE](
	[PAG_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[PAG_C_TITLE] [varchar](120) NOT NULL,
	[PAG_C_ALIAS] [varchar](80) NOT NULL,
	[PAG_N_ARE_N_ID] [int] NOT NULL,
	[PAG_N_STATUS] [int] NOT NULL,
	[PAG_C_METATAGS] [varchar](1000) NOT NULL,
	[PAG_C_KEYWORDS] [varchar](1000) NOT NULL,
	[PAG_C_READERS] [varchar](200) NOT NULL,
	[PAG_C_EDITORS] [varchar](100) NOT NULL,
	[PAG_D_CREATION] [datetime] NOT NULL,
	[PAG_C_CREATOR] [varchar](200) NOT NULL,
	[PAG_D_LASTPUBLISH] [datetime] NULL,
	[PAG_C_LASTPUBLISHER] [varchar](200) NULL,
	[PAG_N_PUBLISHED] [bit] NOT NULL,
	[PAG_N_LOCALONLY] [bit] NOT NULL,
	[PAG_N_SYSTEMPAGE] [bit] NOT NULL,
 CONSTRAINT [PK_WPPAG_PAGE] PRIMARY KEY CLUSTERED 
(
	[PAG_N_ID] ASC
))

GO
CREATE TABLE [WPPOR_PORTAL](
	[POR_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[POR_C_NAME] [nvarchar](40) NOT NULL,
	[POR_C_ALIAS] [nvarchar](40) NOT NULL,
	[POR_C_FOLDER] [nvarchar](20) NOT NULL,
	[POR_N_ADMROLE] [int] NOT NULL,
	[POR_N_ROOTAREA] [int] NOT NULL,
	[POR_C_READERS] [nvarchar](200) NOT NULL,
	[POR_N_SYSTEMPORTAL] [bit] NOT NULL,
	[POR_N_LOCALONLY] [bit] NOT NULL,
	[POR_C_LANGUAGE] [varchar](5) NOT NULL,
 CONSTRAINT [PK_Portals] PRIMARY KEY CLUSTERED 
(
	[POR_N_ID] ASC
))

GO
CREATE TABLE [WPPSH_PAGE_SEARCH](
	[PSH_N_CTT_N_ID] [int] NOT NULL,
	[PSH_N_PAG_N_ID] [int] NOT NULL,
	[PSH_C_SEARCHTEXT] [text] NOT NULL,
 CONSTRAINT [PK_WPPSH_PAGE_SEARCH_1] PRIMARY KEY CLUSTERED 
(
	[PSH_N_CTT_N_ID] ASC
))

GO
CREATE TABLE [WPRI_PRIORIDADE](
	[PRI_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[PRI_N_PRO_N_CODIGO] [int] NOT NULL,
	[PRI_C_TITULO] [varchar](20) NOT NULL,
	[PRI_N_VALOR] [int] NOT NULL,
 CONSTRAINT [PK_WPRI_PRIORIDADE] PRIMARY KEY CLUSTERED 
(
	[PRI_N_CODIGO] ASC
))

GO
CREATE TABLE [WPRO_PROCESSO](
	[PRO_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[PRO_C_NOME] [varchar](50) NOT NULL,
	[PRO_C_DESCRICAO] [text] NOT NULL CONSTRAINT [DF_WPRO_PROCESSO_PRO_C_DESCRICAO]  DEFAULT (''),
	[PRO_N_ARE_N_CODIGO] [int] NOT NULL,
	[PRO_C_GESTORES] [varchar](100) NULL,
	[PRO_N_ATIVO] [bit] NOT NULL,
	[PRO_N_EDICAO] [bit] NOT NULL,
	[PRO_D_CRIACAO] [datetime] NOT NULL CONSTRAINT [DF_WPRO_PROCESSO_PRO_D_CRIACAO]  DEFAULT (getdate()),
	[PRO_N_USU_CRIADOR] [int] NOT NULL,
	[PRO_D_ALTERACAO] [datetime] NULL,
	[PRO_N_USU_ALTERADOR] [int] NULL,
	[PRO_N_ARQUIVAMENTO] [smallint] NOT NULL,
	[PRO_N_ETA_INICIAL] [int] NOT NULL CONSTRAINT [DF_WPRO_PROCESSO_PRO_N_ETA_INICIAL]  DEFAULT ((-1)),
	[PRO_C_TITULOITEM] [varchar](200) NOT NULL CONSTRAINT [DF_WPRO_PROCESSO_PRO_C_TITULOITEM]  DEFAULT (''),
	[PRO_C_DESIGN] [text] NULL CONSTRAINT [DF_WPRO_PROCESSO_PRO_C_DESIGN]  DEFAULT (''),
	[PRO_N_USECOUNTER] [bit] NOT NULL,
	[PRO_N_SKIPDUPLICATE] [bit] NOT NULL,
	[PRO_N_ADDCOMMENT] [bit] NOT NULL,
	[PRO_N_ADDFILE] [bit] NOT NULL,
	[PRO_C_METADATA] [text] NULL,
	[PRO_C_IDENTIFIER] [varchar](36) NOT NULL CONSTRAINT [DF_WPRO_PROID_IDENTIFIER]  DEFAULT (newid()),
 CONSTRAINT [PK_WPRO_PROCESSO] PRIMARY KEY CLUSTERED 
(
	[PRO_N_CODIGO] ASC
))

GO
CREATE TABLE [WPRZ_PRAZO](
	[PRZ_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[PRZ_N_ETA_N_CODIGO] [int] NOT NULL,
	[PRZ_N_PRI_N_CODIGO] [int] NOT NULL,
	[PRZ_N_TIPO] [smallint] NOT NULL,
	[PRZ_C_VALOR] [varchar](200) NULL,
	[PRZ_N_ACAO] [smallint] NOT NULL,
	[PRZ_C_PARAM_ACAO] [varchar](250) NOT NULL,
	[PRZ_C_COR] [varchar](8) NOT NULL,
	[PRZ_N_LOOP] [bit] NOT NULL,
	[PRZ_C_NOME] [varchar](50) NOT NULL,
	[PRZ_C_STATUS] [varchar](50) NULL,
	[PRZ_N_MOD_N_CODIGO] [int] NULL,
	[PRZ_N_CONFIGURED] [bit] NULL,
	[PRZ_N_ETS_N_CODIGO] [int] NULL,
	[PRZ_C_IDENTIFIER] [varchar](36) NOT NULL,
 CONSTRAINT [PK_WPRZ_PRAZO] PRIMARY KEY CLUSTERED 
(
	[PRZ_N_CODIGO] ASC
))

GO
CREATE TABLE [WPSCH_PAGE_SCHEDULE](
	[SCH_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[SCH_N_PAGOUT_N_ID] [int] NOT NULL,
	[SCH_N_PAGIN_N_ID] [int] NOT NULL,
	[SCH_D_SCHEDULE] [datetime] NOT NULL,
 CONSTRAINT [PK_WPSCH_PAGE_SCHEDULE] PRIMARY KEY CLUSTERED 
(
	[SCH_N_ID] ASC
))

GO
CREATE TABLE [WPTAG_TAGS](
	[TAG_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[TAG_C_NAME] [varchar](100) NOT NULL,
	[TAG_C_VIEWURL] [varchar](200) NOT NULL,
	[TAG_N_IDENTIFIER] [varchar](50) NOT NULL,
	[TAG_C_QUALIFIER] [varchar](50) NOT NULL,
	[TAG_C_READERS] [varchar](200) NOT NULL,
 CONSTRAINT [PK_TGTAG_TAGS] PRIMARY KEY CLUSTERED 
(
	[TAG_N_ID] ASC
))

GO
CREATE TABLE [WPTRK_TRACKING](
	[TRK_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[TRK_C_PAGEALIAS] [varchar](80) NOT NULL,
	[TRK_N_PAG_N_ID] [int] NOT NULL,
	[TRK_C_AREANAME] [varchar](50) NOT NULL,
	[TRK_N_ARE_N_ID] [int] NOT NULL,
	[TRK_C_PORTALNAME] [varchar](40) NOT NULL,
	[TRK_N_POR_N_ID] [int] NOT NULL,
	[TRK_C_USERNAME] [varchar](200) NOT NULL,
	[TRK_C_USR_N_ID] [int] NOT NULL,
	[TRK_C_USERIP] [varchar](20) NOT NULL,
	[TRK_N_MEI_N_ID] [int] NOT NULL,
	[TRK_C_MENUPATH] [varchar](200) NOT NULL,
	[TRK_D_TIMESTAMP] [datetime] NOT NULL,
 CONSTRAINT [PK_WPTRK_TRACKING] PRIMARY KEY CLUSTERED 
(
	[TRK_N_ID] ASC
))

GO
CREATE TABLE [WPUCP_USER_COMPLEMENT](
	[UCP_N_USU_N_ID] [int] NOT NULL,
	[UCP_C_PHONEHOM] [varchar](18) NULL,
	[UCP_C_PHONEWK] [varchar](18) NULL,
	[UCP_C_PHONEMOB] [varchar](18) NULL,
	[UCP_C_CONTACT] [varchar](50) NULL,
	[UCP_C_ADDRESS] [varchar](200) NULL,
	[UCP_C_NEIGHBORHOOD] [varchar](50) NULL,
	[UCP_C_CITY] [varchar](50) NULL,
	[UCP_C_ZIP] [varchar](50) NULL,
	[UCP_C_STATE] [varchar](2) NULL,
	[UCP_C_AREA] [varchar](30) NULL,
	[UCP_C_EXTENTION] [varchar](8) NULL,
	[UCP_C_CPF] [varchar](12) NULL,
	[UCP_C_CGC] [varchar](14) NULL,
	[UCP_C_NICKNAME] [varchar](200) NULL,
	[UCP_C_JOBTITLE] [varchar](300) NULL,
	[UCP_B_KEYUSER] [bit] NULL,
	[UCP_C_MANAGER] [varchar](100) NULL,
 CONSTRAINT [PK_WPUCP_USER_COMPLEMENT] PRIMARY KEY CLUSTERED 
(
	[UCP_N_USU_N_ID] ASC
))

GO
CREATE TABLE [WPVW_PROCESSGPSVIEW](
	[PVW_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[PVW_C_IDENTIFIER] [varchar](36) NOT NULL CONSTRAINT [DF_PVW_C_IDENTIFIER]  DEFAULT (newid()),
	[PVW_PRO_N_CODIGO] [int] NOT NULL,
	[PVW_C_NAME] [varchar](255) NOT NULL,
	[PVW_C_ACCESSLIST] [varchar](100) NULL,
	[PVW_C_CONFIG] [varchar](max) NOT NULL,
	[PVW_C_PROVIDER] [varchar](36) NOT NULL,
	[PVW_N_PRIORITY] [int] NOT NULL,
 CONSTRAINT [PK_PROCESSVIEW] PRIMARY KEY CLUSTERED 
(
	[PVW_N_ID] ASC
))

GO
CREATE TABLE [WWKD_WORKDAYS](
	[WKD_N_CODIGO] [int] IDENTITY(1,1) NOT NULL,
	[WKD_N_PRO_N_CODIGO] [int] NOT NULL,
	[WKD_N_ETA_N_CODIGO] [int] NOT NULL CONSTRAINT [DF_WWKD_WORKDAYS_WKD_N_ETA_N_CODIGO]  DEFAULT ((-1)),
	[WKD_C_SEG_SEX_INI] [varchar](5) NOT NULL,
	[WKD_C_SEG_SEX_FIM] [varchar](5) NOT NULL,
	[WKD_C_SABADO_INI] [varchar](5) NULL,
	[WKD_C_SABADO_FIM] [varchar](5) NULL,
	[WKD_C_DOMINGO_INI] [varchar](5) NULL,
	[WKD_C_DOMINGO_FIM] [varchar](5) NULL,
 CONSTRAINT [PK_WWKD_WORKDAYS] PRIMARY KEY CLUSTERED 
(
	[WKD_N_CODIGO] ASC
))

GO
CREATE TABLE [WZCF_ZURI_CONFIGURATION](
	[ZCF_N_ID] [int] IDENTITY(1,1) NOT NULL,
	[ZCF_C_CONFIGITEM] [varchar](50) NOT NULL,
	[ZCF_C_CONFIGALIAS] [varchar](50) NULL,
	[ZCF_N_CONFIGID] [int] NOT NULL,
	[ATC_C_CONFIGURATION] [text] NOT NULL,
 CONSTRAINT [PK_ZCF_ZURI_CONFIGURATION] PRIMARY KEY CLUSTERED 
(
	[ZCF_N_ID] ASC
))

GO

CREATE PROCEDURE [apr_GetTotaisPedido](
	@ITEMID INT
)
AS
BEGIN
	IF EXISTS(SELECT NOME FROM APR_PEDITEM A INNER JOIN APR_PEDPEDIDO B ON A.ITEMID = B.ITEMID INNER JOIN APR_PEDCLI ON CodigoAutomatico = B.N_CLIENTE WHERE A.ITEMID = @ITEMID)
	SELECT NOME AS CLIENTE, ISNULL(SUM([N_QUANTIDADE]),0) AS ITEMCOUNT,FORMAT(ISNULL(SUM(CONVERT(DECIMAL(10,2),N_VALOR)),0),'C','pt-BR') AS TOTALVALUE 
	FROM APR_PEDITEM A
	INNER JOIN APR_PEDPEDIDO B ON A.ITEMID = B.ITEMID
	INNER JOIN APR_PEDCLI ON CodigoAutomatico = B.N_CLIENTE
	WHERE A.ITEMID = @ITEMID
	GROUP BY NOME
	ELSE
	SELECT '' AS CLIENTE, 0 AS ITEMCOUNT,'R$ 0,00' AS TOTALVALUE 
END


GO
