SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10018](
	[idtarjetaincapacidad] [int] IDENTITY(1,1) NOT NULL,
	[idtipoincidencia] [int] NULL,
	[idempleado] [int] NULL,
	[folio] [varchar](20) NULL,
	[diasautorizados] [int] NULL,
	[fechainicio] [datetime] NULL,
	[descripcion] [varchar](40) NULL,
	[incapacidadinicial] [varchar](1) NULL,
	[ramoseguro] [varchar](1) NULL,
	[tiporiesgo] [varchar](1) NULL,
	[numerocaso] [int] NULL,
	[fincaso] [bit] NOT NULL CONSTRAINT [DF_nom10018_fincaso]  DEFAULT ((0)),
	[porcentajeincapacidad] [float] NULL,
	[controlmaternidad] [bit] NOT NULL CONSTRAINT [DF_nom10018_controlmaternidad]  DEFAULT ((0)),
	[nombremedico] [varchar](40) NULL,
	[matriculamedico] [varchar](40) NULL,
	[circunstancia] [varchar](1) NULL,
	[timestamp] [datetime] NULL,
	[controlincapacidad] [char](1) NULL,
	[secuelaconsecuencia] [char](1) NULL,
 CONSTRAINT [PK_nom10018] PRIMARY KEY CLUSTERED 
(
	[idtarjetaincapacidad] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXEMPLEADO] ON [dbo].[nom10018] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOFOLIO] ON [dbo].[nom10018] 
(
	[idempleado] ASC,
	[folio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADONUMEROCASO] ON [dbo].[nom10018] 
(
	[idempleado] ASC,
	[numerocaso] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXFOLIO] ON [dbo].[nom10018] 
(
	[folio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10019](
	[idempleado] [int] NOT NULL,
	[fecha] [datetime] NOT NULL,
	[tiposueldo] [char](1) NOT NULL,
	[sueldo] [float] NULL,
	[cidperiodo] [int] NULL,
	[cidtipoperiodo] [int] NULL,
 CONSTRAINT [PK_nom10019] PRIMARY KEY CLUSTERED 
(
	[idempleado] ASC,
	[fecha] ASC,
	[tiposueldo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXEMPLEADOFECHA] ON [dbo].[nom10019] 
(
	[idempleado] DESC,
	[fecha] DESC,
	[tiposueldo] DESC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOTIPO] ON [dbo].[nom10019] 
(
	[idempleado] ASC,
	[tiposueldo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOTIPOPERIODO] ON [dbo].[nom10019] 
(
	[idempleado] ASC,
	[cidtipoperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10020](
	[idbajareingreso] [int] IDENTITY(1,1) NOT NULL,
	[idempleado] [int] NULL,
	[clavebajareingreso] [char](1) NULL,
	[fecha] [datetime] NULL,
	[cidperiodo] [int] NULL,
	[cidtipoperiodo] [int] NULL,
 CONSTRAINT [PK_nom10020] PRIMARY KEY CLUSTERED 
(
	[idbajareingreso] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXEMPLEADO] ON [dbo].[nom10020] 
(
	[idempleado] ASC,
	[fecha] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOFECHA] ON [dbo].[nom10020] 
(
	[idempleado] DESC,
	[fecha] DESC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOFECHATIPOPER] ON [dbo].[nom10020] 
(
	[idempleado] ASC,
	[fecha] ASC,
	[cidtipoperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXPRIMARYKEY] ON [dbo].[nom10020] 
(
	[fecha] DESC,
	[clavebajareingreso] DESC,
	[idempleado] DESC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10022](
	[idtipoincidencia] [int] IDENTITY(1,1) NOT NULL,
	[descripcion] [varchar](40) NULL,
	[mnemonico] [varchar](4) NULL,
	[derechosueldo] [bit] NOT NULL CONSTRAINT [DF_nom10022_derechosueldo]  DEFAULT ((0)),
	[porcentajesueldo] [float] NULL,
	[tipoimss] [varchar](1) NULL,
	[tipoincidencia] [varchar](1) NULL,
	[derechoseptimodia] [bit] NOT NULL CONSTRAINT [DF_nom10022_derechoseptimodia]  DEFAULT ((0)),
	[timestamp] [datetime] NULL,
	[valorunidad] [float] NULL,
 CONSTRAINT [PK_nom10022] PRIMARY KEY CLUSTERED 
(
	[idtipoincidencia] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXDESCRIPCION] ON [dbo].[nom10022] 
(
	[descripcion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXMNEMONICO] ON [dbo].[nom10022] 
(
	[mnemonico] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXTIPOINCIDENCIA] ON [dbo].[nom10022] 
(
	[tipoincidencia] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10024](
	[iddispfiscal] [int] IDENTITY(1,1) NOT NULL,
	[tipo] [varchar](1) NULL,
	[descripcion] [varchar](40) NULL,
	[ruta] [varchar](255) NULL,
	[fechainicio] [varchar](5) NULL,
	[frecuencia] [varchar](1) NULL,
	[activada] [bit] NOT NULL CONSTRAINT [DF_nom10024_activada]  DEFAULT ((0)),
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10024] PRIMARY KEY CLUSTERED 
(
	[iddispfiscal] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXDESCRIPCION] ON [dbo].[nom10024] 
(
	[descripcion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXFECHAINICIO] ON [dbo].[nom10024] 
(
	[fechainicio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXFFRECUENCIA] ON [dbo].[nom10024] 
(
	[fechainicio] ASC,
	[frecuencia] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10025](
	[idperiodo] [int] NOT NULL,
	[fecha] [datetime] NOT NULL,
 CONSTRAINT [PK_nom10025] PRIMARY KEY CLUSTERED 
(
	[idperiodo] ASC,
	[fecha] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXIDPERIODO] ON [dbo].[nom10025] 
(
	[idperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10027](
	[numerotabla] [int] IDENTITY(1,1) NOT NULL,
	[descripcion] [varchar](40) NULL,
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10027] PRIMARY KEY CLUSTERED 
(
	[numerotabla] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXDESCRIPCION] ON [dbo].[nom10027] 
(
	[descripcion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10028](
	[numerotabla] [int] NOT NULL,
	[numerocolumna] [int] NOT NULL,
	[descripcion] [varchar](40) NULL,
	[tipocolumna] [varchar](1) NULL,
 CONSTRAINT [PK_nom10028] PRIMARY KEY CLUSTERED 
(
	[numerotabla] ASC,
	[numerocolumna] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10029](
	[numerotabla] [int] NOT NULL,
	[numerocolumna] [int] NOT NULL,
	[numerorenglon] [int] NOT NULL,
	[valor] [float] NULL,
	[fecha] [datetime] NULL,
 CONSTRAINT [PK_nom10029] PRIMARY KEY CLUSTERED 
(
	[numerotabla] ASC,
	[numerocolumna] ASC,
	[numerorenglon] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10031](
	[idformula] [int] IDENTITY(1,1) NOT NULL,
	[idcategoria] [int] NULL,
	[nombre] [varchar](40) NULL,
	[tipo] [varchar](1) NULL,
	[posicion] [int] NULL,
	[descripcion] [text] NULL,
	[ayuda] [text] NULL,
	[expresion] [text] NULL,
	[modificado] [bit] NOT NULL CONSTRAINT [DF_nom10031_modificado]  DEFAULT ((0)),
	[timestamp] [datetime] NULL,
	[version] [int] NULL,
 CONSTRAINT [PK_nom10031] PRIMARY KEY CLUSTERED 
(
	[idformula] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXCATEGORIAPOSICION] ON [dbo].[nom10031] 
(
	[idcategoria] ASC,
	[posicion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXNOMBRE] ON [dbo].[nom10031] 
(
	[nombre] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXPOSICION] ON [dbo].[nom10031] 
(
	[posicion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10033](
	[idmodelo] [int] IDENTITY(1,1) NOT NULL,
	[archivo] [varchar](255) NULL,
	[descripcion] [varchar](40) NULL,
 CONSTRAINT [PK_nom10033] PRIMARY KEY CLUSTERED 
(
	[idmodelo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10035](
	[cidregistropatronal] [int] IDENTITY(1,1) NOT NULL,
	[crfc] [varchar](4) NULL,
	[cfechaconstitucion] [datetime] NULL,
	[chomoclave] [varchar](3) NULL,
	[ctimestamp] [datetime] NULL,
	[crfccompleto] [varchar](19) NULL,
	[cregistroimss] [varchar](19) NULL,
 CONSTRAINT [PK_nom10035] PRIMARY KEY CLUSTERED 
(
	[cidregistropatronal] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXREGISTROIMSS] ON [dbo].[nom10035] 
(
	[cregistroimss] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXRFCCOMPLETO] ON [dbo].[nom10035] 
(
	[crfccompleto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom100xx](
	[idempleado] [int] NOT NULL,
	[idtipoperiodo] [int] NOT NULL,
	[cidperiodo] [int] NOT NULL,
	[iddepartamento] [int] NULL,
	[idpuesto] [int] NULL,
	[idturno] [int] NULL,
	[estadocivil] [varchar](1) NULL,
	[umf] [int] NULL,
	[cuentapagoelectronico] [varchar](20) NULL,
	[sucursalpagoelectronico] [varchar](50) NULL,
	[bancopagoelectronico] [int] NULL,
	[estadoempleado] [varchar](1) NULL,
	[sueldodiario] [float] NULL,
	[fechasueldodiario] [datetime] NULL,
	[sueldovariable] [float] NULL,
	[fechasueldovariable] [datetime] NULL,
	[sueldopromedio] [float] NULL,
	[fechasueldopromedio] [datetime] NULL,
	[sueldointegrado] [float] NULL,
	[fechasueldointegrado] [datetime] NULL,
	[calculado] [bit] NOT NULL,
	[afectado] [bit] NULL,
	[calculadoextraordinario] [bit] NOT NULL,
	[afectadoextraordinario] [bit] NULL,
	[interfazcheqpaqw] [bit] NOT NULL,
	[modificacionneto] [bit] NOT NULL,
	[fechaalta] [datetime] NULL,
	[cuentacw] [varchar](31) NULL,
	[tipocontrato] [varchar](1) NULL,
	[basecotizacionimss] [varchar](1) NULL,
	[tipoempleado] [varchar](1) NULL,
	[basepago] [varchar](1) NULL,
	[formapago] [varchar](1) NULL,
	[zonasalario] [varchar](1) NULL,
	[modificacionsalarioimss] [bit] NOT NULL,
	[altaimss] [bit] NOT NULL,
	[bajaimss] [bit] NOT NULL,
	[cambiocotizacionimss] [bit] NOT NULL,
	[telefono] [varchar](20) NULL,
	[codigopostal] [int] NULL,
	[direccion] [varchar](60) NULL,
	[poblacion] [varchar](60) NULL,
	[estado] [varchar](20) NULL,
	[numeroafore] [varchar](50) NULL,
	[fechabaja] [datetime] NULL,
	[causabaja] [varchar](60) NULL,
	[sueldobaseliquidacion] [float] NULL,
	[campoextra1] [varchar](80) NULL,
	[campoextra2] [varchar](80) NULL,
	[campoextra3] [varchar](80) NULL,
	[fechareingreso] [datetime] NULL,
	[ajustealneto] [int] NULL,
	[timestamp] [datetime] NULL,
	[cidregistropatronal] [int] NULL,
	[cestadoempleadoperiodo] [varchar](4) NULL,
	[ccampoextranumerico1] [float] NULL,
	[ccampoextranumerico2] [float] NULL,
	[ccampoextranumerico3] [float] NULL,
	[ccampoextranumerico4] [float] NULL,
	[ccampoextranumerico5] [float] NULL,
	[cdiastrabajados] [float] NULL,
	[cdiaspagados] [float] NULL,
	[cdiascotizados] [float] NULL,
	[cdiasausencia] [float] NULL,
	[cdiasincapacidades] [float] NULL,
	[cdiasvacaciones] [float] NULL,
	[cdiaspropseptimos] [float] NULL,
	[chorasextras1] [float] NULL,
	[chorasextras2] [float] NULL,
	[chorasextras3] [float] NULL,
	[cfechasueldomixto] [datetime] NULL,
	[csueldomixto] [float] NULL,
	[cfechacorte] [datetime] NULL
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nomdates](
	[table] [varchar](255) NULL,
	[date] [datetime] NULL
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nomsimul](
	[idresultado] [int] IDENTITY(1,1) NOT NULL,
	[idempleado] [int] NULL,
	[nombre] [varchar](110) NULL,
	[ids] [char](10) NULL,
	[consecutivo] [char](10) NULL,
	[tipo] [varchar](2) NULL,
	[expresion] [text] NULL,
	[resultado] [float] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXIDEMPLEADO] ON [dbo].[nomsimul] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDEMPLEADOIDSTIPO] ON [dbo].[nomsimul] 
(
	[idempleado] ASC,
	[ids] ASC,
	[tipo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10001](
	[idempleado] [int] IDENTITY(1,1) NOT NULL,
	[iddepartamento] [int] NULL,
	[idpuesto] [int] NULL,
	[idtipoperiodo] [int] NULL,
	[idturno] [int] NULL,
	[codigoempleado] [varchar](30) NULL,
	[nombre] [varchar](40) NULL,
	[fotografia] [image] NULL,
	[apellidopaterno] [varchar](40) NULL,
	[apellidomaterno] [varchar](40) NULL,
	[nombrelargo] [varchar](120) NULL,
	[fechanacimiento] [datetime] NULL,
	[lugarnacimiento] [varchar](40) NULL,
	[estadocivil] [varchar](1) NULL,
	[sexo] [varchar](1) NULL,
	[curpi] [varchar](6) NULL,
	[curpf] [varchar](8) NULL,
	[numerosegurosocial] [varchar](11) NULL,
	[umf] [int] NULL,
	[rfc] [varchar](4) NULL,
	[homoclave] [varchar](4) NULL,
	[cuentapagoelectronico] [varchar](20) NULL,
	[sucursalpagoelectronico] [varchar](50) NULL,
	[bancopagoelectronico] [int] NULL,
	[estadoempleado] [varchar](1) NULL,
	[sueldodiario] [float] NULL,
	[fechasueldodiario] [datetime] NULL,
	[sueldovariable] [float] NULL,
	[fechasueldovariable] [datetime] NULL,
	[sueldopromedio] [float] NULL,
	[fechasueldopromedio] [datetime] NULL,
	[sueldointegrado] [float] NULL,
	[fechasueldointegrado] [datetime] NULL,
	[calculado] [bit] NOT NULL CONSTRAINT [DF_nom10001_calculado]  DEFAULT ((0)),
	[afectado] [bit] NOT NULL CONSTRAINT [DF_nom10001_afectado]  DEFAULT ((0)),
	[calculadoextraordinario] [bit] NOT NULL CONSTRAINT [DF_nom10001_calculadoextraordinario]  DEFAULT ((0)),
	[afectadoextraordinario] [bit] NULL CONSTRAINT [DF_nom10001_afectadoextraordinario]  DEFAULT ((0)),
	[interfazcheqpaqw] [bit] NOT NULL CONSTRAINT [DF_nom10001_interfazcheqpaqw]  DEFAULT ((0)),
	[modificacionneto] [bit] NOT NULL CONSTRAINT [DF_nom10001_modificacionneto]  DEFAULT ((0)),
	[fechaalta] [datetime] NULL,
	[cuentacw] [varchar](31) NULL,
	[tipocontrato] [varchar](1) NULL,
	[basecotizacionimss] [varchar](1) NULL,
	[tipoempleado] [varchar](1) NULL,
	[basepago] [varchar](1) NULL,
	[formapago] [varchar](1) NULL,
	[zonasalario] [varchar](1) NULL,
	[calculoptu] [bit] NOT NULL CONSTRAINT [DF_nom10001_calculoptu]  DEFAULT ((0)),
	[calculoaguinaldo] [bit] NOT NULL CONSTRAINT [DF_nom10001_calculoaguinaldo]  DEFAULT ((0)),
	[modificacionsalarioimss] [bit] NOT NULL CONSTRAINT [DF_nom10001_modificacionsalarioimss]  DEFAULT ((0)),
	[altaimss] [bit] NOT NULL CONSTRAINT [DF_nom10001_altaimss]  DEFAULT ((0)),
	[bajaimss] [bit] NOT NULL CONSTRAINT [DF_nom10001_bajaimss]  DEFAULT ((0)),
	[cambiocotizacionimss] [bit] NOT NULL CONSTRAINT [DF_nom10001_cambiocotizacionimss]  DEFAULT ((0)),
	[expediente] [text] NULL,
	[telefono] [varchar](20) NULL,
	[codigopostal] [int] NULL,
	[direccion] [varchar](60) NULL,
	[poblacion] [varchar](60) NULL,
	[estado] [varchar](20) NULL,
	[nombrepadre] [varchar](60) NULL,
	[nombremadre] [varchar](60) NULL,
	[numeroafore] [varchar](50) NULL,
	[fechabaja] [datetime] NULL,
	[causabaja] [varchar](60) NULL,
	[sueldobaseliquidacion] [float] NULL,
	[campoextra1] [varchar](40) NULL,
	[campoextra2] [varchar](40) NULL,
	[campoextra3] [varchar](40) NULL,
	[fechareingreso] [datetime] NULL,
	[ajustealneto] [float] NULL,
	[timestamp] [datetime] NULL,
	[cidregistropatronal] [int] NULL,
	[ccampoextranumerico1] [float] NULL,
	[ccampoextranumerico2] [float] NULL,
	[ccampoextranumerico3] [float] NULL,
	[ccampoextranumerico4] [float] NULL,
	[ccampoextranumerico5] [float] NULL,
	[cestadoempleadoperiodo] [varchar](4) NULL,
	[cfechasueldomixto] [datetime] NULL,
	[csueldomixto] [float] NULL,
 CONSTRAINT [PK_nom10001] PRIMARY KEY CLUSTERED 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXCODIGOEMPLEADO] ON [dbo].[nom10001] 
(
	[codigoempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXDEPTOTIPOPER] ON [dbo].[nom10001] 
(
	[iddepartamento] ASC,
	[idtipoperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDDEPTO] ON [dbo].[nom10001] 
(
	[iddepartamento] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDDEPTOCODIGO] ON [dbo].[nom10001] 
(
	[iddepartamento] ASC,
	[codigoempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDEMPLEADOTIPOPERIODO] ON [dbo].[nom10001] 
(
	[idempleado] ASC,
	[idtipoperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXNOMBRE] ON [dbo].[nom10001] 
(
	[nombrelargo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXTIPOPERIODO] ON [dbo].[nom10001] 
(
	[idtipoperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXTIPOPERIODOCODIGO] ON [dbo].[nom10001] 
(
	[idtipoperiodo] ASC,
	[codigoempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXTIPOPERIODODEPTO] ON [dbo].[nom10001] 
(
	[idtipoperiodo] ASC,
	[iddepartamento] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[Nom1000x](
	[idmovtopdo] [int] NULL,
	[idperiodo] [int] NULL,
	[idempleado] [int] NULL,
	[idconcepto] [int] NULL,
	[idmovtopermanente] [int] NULL,
	[importetotal] [float] NULL,
	[valor] [float] NULL,
	[importe1] [float] NULL,
	[importe2] [float] NULL,
	[importe3] [float] NULL,
	[importe4] [float] NULL,
	[importetotalreportado] [bit] NOT NULL,
	[importe1reportado] [bit] NOT NULL,
	[importe2reportado] [bit] NOT NULL,
	[importe3reportado] [bit] NOT NULL,
	[importe4reportado] [bit] NOT NULL,
	[timestam_] [datetime] NULL
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10000](
	[idcptoprimavac] [int] NULL,
	[idcptoaguinaldo] [int] NULL,
	[idcptoptu] [int] NULL,
	[idcptovacaciones] [int] NULL,
	[nombrecorto] [varchar](15) NULL,
	[rutarespaldo] [varchar](255) NULL,
	[rutacontpaqw] [varchar](255) NULL,
	[rutacheqpaqw] [varchar](255) NULL,
	[idempresacontpaqw] [int] NULL,
	[direccion] [varchar](60) NULL,
	[telefono1] [varchar](20) NULL,
	[telefono2] [varchar](20) NULL,
	[telefono3] [varchar](20) NULL,
	[fax] [varchar](20) NULL,
	[registroimss] [varchar](20) NULL,
	[registrocamara] [varchar](50) NULL,
	[rfc] [varchar](4) NULL,
	[homoclave] [varchar](4) NULL,
	[registroinfonavit] [varchar](20) NULL,
	[registrofonacot] [varchar](20) NULL,
	[registrocomisionmixta] [varchar](50) NULL,
	[registrossa] [varchar](50) NULL,
	[zonasalariogeneral] [varchar](1) NULL,
	[fechainiciohistoria] [datetime] NULL,
	[fechaconstitucion] [datetime] NULL,
	[ejercicio] [int] NULL,
	[porcentajesubsidio] [float] NULL,
	[cuentacwglobal] [varchar](31) NULL,
	[estructuracuentacw] [varchar](9) NULL,
	[formatosobrerecibo] [varchar](255) NULL,
	[afectarperiodosanteriores] [bit] NOT NULL CONSTRAINT [DF_nom10000_afectarperiodosanteriores]  DEFAULT ((1)),
	[afectarperiodosfuturos] [bit] NOT NULL CONSTRAINT [DF_nom10000_afectarperiodosfuturos]  DEFAULT ((1)),
	[posicioncuentaempleado] [int] NULL,
	[longitudcuentaempleado] [int] NULL,
	[posicioncuentadepto] [int] NULL,
	[longitudcuentadepto] [int] NULL,
	[localidad] [varchar](40) NULL,
	[nombrerepresentante] [varchar](40) NULL,
	[appaternorepresentante] [varchar](40) NULL,
	[apmaternorepresentante] [varchar](40) NULL,
	[codigopostal] [int] NULL,
	[apartadopostal] [varchar](11) NULL,
	[mascarillacodigo] [varchar](30) NULL,
	[numerodecimales] [int] NULL,
	[tipocodigoempleado] [varchar](1) NULL,
	[mostraragenda] [bit] NOT NULL CONSTRAINT [DF_nom10000_mostraragenda]  DEFAULT ((1)),
	[timestamp] [datetime] NULL,
	[idcptoajuste] [int] NULL,
	[idcptoindem20] [int] NULL,
	[idcptoindem90] [int] NULL,
	[idcptoprimaantig] [int] NULL,
	[idcptoprimavacrep] [int] NULL,
	[idcptosueldo] [int] NULL,
	[idcptovacrep] [int] NULL
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10003](
	[iddepartamento] [int] IDENTITY(1,1) NOT NULL,
	[numerodepartamento] [int] NULL,
	[descripcion] [varchar](40) NULL,
	[beneficiario] [varchar](60) NULL,
	[cuentacw] [varchar](31) NULL,
	[timestamp] [datetime] NULL,
	[csegmentonegocio] [int] NULL,
 CONSTRAINT [PK_nom10003] PRIMARY KEY CLUSTERED 
(
	[iddepartamento] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXDESCRIPCION] ON [dbo].[nom10003] 
(
	[descripcion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXNUMERODEPARTAMENTO] ON [dbo].[nom10003] 
(
	[numerodepartamento] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10004](
	[idconcepto] [int] IDENTITY(1,1) NOT NULL,
	[numeroconcepto] [int] NULL,
	[tipoconcepto] [varchar](1) NULL,
	[descripcion] [varchar](40) NULL,
	[especie] [bit] NOT NULL CONSTRAINT [DF_nom10004_especie]  DEFAULT ((0)),
	[automaticoglobal] [bit] NOT NULL CONSTRAINT [DF_nom10004_automaticoglobal]  DEFAULT ((0)),
	[automaticoliquidacion] [bit] NOT NULL CONSTRAINT [DF_nom10004_automaticoliquidacion]  DEFAULT ((0)),
	[imprimir] [bit] NOT NULL CONSTRAINT [DF_nom10004_imprimir]  DEFAULT ((0)),
	[articulo86] [bit] NOT NULL CONSTRAINT [DF_nom10004_articulo86]  DEFAULT ((0)),
	[leyendaimporte1] [varchar](40) NULL,
	[leyendaimporte2] [varchar](40) NULL,
	[leyendaimporte3] [varchar](40) NULL,
	[leyendaimporte4] [varchar](40) NULL,
	[cuentacw] [varchar](31) NULL,
	[tipomovtocw] [varchar](1) NULL,
	[contracuentacw] [varchar](31) NULL,
	[contabcuentacw] [varchar](1) NULL,
	[contabcontracuentacw] [varchar](1) NULL,
	[leyendavalor] [varchar](40) NULL,
	[formulaimportetotal] [text] NULL,
	[formulaimporte1] [text] NULL,
	[formulaimporte2] [text] NULL,
	[formulaimporte3] [text] NULL,
	[formulaimporte4] [text] NULL,
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10004] PRIMARY KEY CLUSTERED 
(
	[idconcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXDESCRIPCION] ON [dbo].[nom10004] 
(
	[descripcion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXNUMEROCONCEPTO] ON [dbo].[nom10004] 
(
	[numeroconcepto] ASC,
	[tipoconcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXTIPOCONCEPTO] ON [dbo].[nom10004] 
(
	[tipoconcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10014](
	[idtcontrolvacaciones] [int] IDENTITY(1,1) NOT NULL,
	[idempleado] [int] NULL,
	[ejercicio] [int] NULL,
	[diasvacaciones] [int] NULL,
	[diasprimavacacional] [float] NULL,
	[fechainicio] [datetime] NULL,
	[fechafin] [datetime] NULL,
	[diasdescanso] [varchar](100) NULL,
	[timestamp] [datetime] NULL,
	[fechapago] [datetime] NULL,
 CONSTRAINT [PK_nom10014] PRIMARY KEY CLUSTERED 
(
	[idtcontrolvacaciones] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXEJERCICIOEMPLEADO] ON [dbo].[nom10014] 
(
	[ejercicio] ASC,
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADO] ON [dbo].[nom10014] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOFECHAINICIO] ON [dbo].[nom10014] 
(
	[idempleado] ASC,
	[fechainicio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXFECHAINICIO] ON [dbo].[nom10014] 
(
	[fechainicio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10017](
	[idmovtopermanente] [int] IDENTITY(1,1) NOT NULL,
	[idempleado] [int] NULL,
	[idconcepto] [int] NULL,
	[descripcion] [varchar](40) NULL,
	[tipo] [char](1) NULL,
	[valor] [float] NULL,
	[vecesaplicar] [int] NULL,
	[vecesaplicado] [int] NULL,
	[montolimite] [float] NULL,
	[montoacumulado] [float] NULL,
	[montoacumuladoejeant] [float] NULL,
	[fecharegistro] [datetime] NULL,
	[numerocontrol] [varchar](40) NULL,
	[estado] [bit] NOT NULL CONSTRAINT [DF_nom10017_estado]  DEFAULT ((0)),
	[timestamp] [datetime] NULL,
	[numerofiltro] [int] NULL,
	[fechainiciotarjeta] [datetime] NULL,
 CONSTRAINT [PK_nom10017] PRIMARY KEY CLUSTERED 
(
	[idmovtopermanente] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXDESCRIPCION] ON [dbo].[nom10017] 
(
	[descripcion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADO] ON [dbo].[nom10017] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADODESCRIPCION] ON [dbo].[nom10017] 
(
	[idempleado] ASC,
	[descripcion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10023](
	[idtipoperiodo] [int] IDENTITY(1,1) NOT NULL,
	[nombretipoperiodo] [varchar](40) NULL,
	[diasdelperiodo] [int] NULL,
	[diasdepago] [float] NULL,
	[periodotrabajo] [int] NULL,
	[modificarhistoria] [bit] NOT NULL CONSTRAINT [DF_nom10023_modificarhistoria]  DEFAULT ((0)),
	[ajustarperiodoscalendario] [bit] NOT NULL CONSTRAINT [DF_nom10023_ajustarperiodoscalendario]  DEFAULT ((0)),
	[numeroseptimos] [int] NULL,
	[posicionseptimos] [varchar](30) NULL,
	[posicionpagonomina] [int] NULL,
	[fechainicioejercicio] [datetime] NULL,
	[ejercicio] [int] NULL,
	[timestamp] [datetime] NULL,
	[ccalculomescalendario] [int] NULL,
 CONSTRAINT [PK_nom10023] PRIMARY KEY CLUSTERED 
(
	[idtipoperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXDIASDELPERIODO] ON [dbo].[nom10023] 
(
	[diasdelperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDTIPOPERIODO] ON [dbo].[nom10023] 
(
	[idtipoperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXNOMBRETIPOPERIODO] ON [dbo].[nom10023] 
(
	[nombretipoperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10026](
	[mes] [int] NOT NULL,
	[dia] [int] NOT NULL,
	[descripcion] [varchar](40) NULL,
 CONSTRAINT [PK_nom10026] PRIMARY KEY CLUSTERED 
(
	[mes] ASC,
	[dia] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10030](
	[idcategoria] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [varchar](40) NULL,
	[grupo] [varchar](1) NULL,
	[tipo] [varchar](1) NULL,
	[posicion] [int] NULL,
	[timestamp] [datetime] NULL,
	[cpropia] [bit] NOT NULL CONSTRAINT [DF_nom10030_cpropia]  DEFAULT ((0)),
 CONSTRAINT [PK_nom10030] PRIMARY KEY CLUSTERED 
(
	[idcategoria] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXPOSICION] ON [dbo].[nom10030] 
(
	[posicion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10032](
	[idturno] [int] IDENTITY(1,1) NOT NULL,
	[numeroturno] [int] NULL,
	[descripcion] [varchar](40) NULL,
	[numerohoras] [float] NULL,
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10032] PRIMARY KEY CLUSTERED 
(
	[idturno] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXDESCRIPCION] ON [dbo].[nom10032] 
(
	[descripcion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXNUMEROTURNO] ON [dbo].[nom10032] 
(
	[numeroturno] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10034](
	[idempleado] [int] NOT NULL,
	[idtipoperiodo] [int] NOT NULL,
	[cidperiodo] [int] NOT NULL,
	[iddepartamento] [int] NULL,
	[idpuesto] [int] NULL,
	[idturno] [int] NULL,
	[estadocivil] [varchar](1) NULL,
	[umf] [int] NULL,
	[cuentapagoelectronico] [varchar](20) NULL,
	[sucursalpagoelectronico] [varchar](50) NULL,
	[bancopagoelectronico] [int] NULL,
	[estadoempleado] [varchar](1) NULL,
	[sueldodiario] [float] NULL,
	[fechasueldodiario] [datetime] NULL,
	[sueldovariable] [float] NULL,
	[fechasueldovariable] [datetime] NULL,
	[sueldopromedio] [float] NULL,
	[fechasueldopromedio] [datetime] NULL,
	[sueldointegrado] [float] NULL,
	[fechasueldointegrado] [datetime] NULL,
	[calculado] [bit] NOT NULL CONSTRAINT [DF_nom10034_calculado]  DEFAULT ((0)),
	[afectado] [bit] NULL CONSTRAINT [DF_nom10034_afectado]  DEFAULT ((0)),
	[calculadoextraordinario] [bit] NOT NULL CONSTRAINT [DF_nom10034_calculadoextraordinario]  DEFAULT ((0)),
	[afectadoextraordinario] [bit] NULL CONSTRAINT [DF_nom10034_afectadoextraordinario]  DEFAULT ((0)),
	[interfazcheqpaqw] [bit] NOT NULL CONSTRAINT [DF_nom10034_interfazcheqpaqw]  DEFAULT ((0)),
	[modificacionneto] [bit] NOT NULL CONSTRAINT [DF_nom10034_modificacionneto]  DEFAULT ((0)),
	[fechaalta] [datetime] NULL,
	[cuentacw] [varchar](31) NULL,
	[tipocontrato] [varchar](1) NULL,
	[basecotizacionimss] [varchar](1) NULL,
	[tipoempleado] [varchar](1) NULL,
	[basepago] [varchar](1) NULL,
	[formapago] [varchar](1) NULL,
	[zonasalario] [varchar](1) NULL,
	[modificacionsalarioimss] [bit] NOT NULL CONSTRAINT [DF_nom10034_modificacionsalarioimss]  DEFAULT ((0)),
	[altaimss] [bit] NOT NULL CONSTRAINT [DF_nom10034_altaimss]  DEFAULT ((0)),
	[bajaimss] [bit] NOT NULL CONSTRAINT [DF_nom10034_bajaimss]  DEFAULT ((0)),
	[cambiocotizacionimss] [bit] NOT NULL CONSTRAINT [DF_nom10034_cambiocotizacionimss]  DEFAULT ((0)),
	[telefono] [varchar](20) NULL,
	[codigopostal] [int] NULL,
	[direccion] [varchar](60) NULL,
	[poblacion] [varchar](60) NULL,
	[estado] [varchar](20) NULL,
	[numeroafore] [varchar](50) NULL,
	[fechabaja] [datetime] NULL,
	[causabaja] [varchar](60) NULL,
	[sueldobaseliquidacion] [float] NULL,
	[campoextra1] [varchar](40) NULL,
	[campoextra2] [varchar](40) NULL,
	[campoextra3] [varchar](40) NULL,
	[fechareingreso] [datetime] NULL,
	[ajustealneto] [float] NULL,
	[timestamp] [datetime] NULL,
	[cidregistropatronal] [int] NULL,
	[cestadoempleadoperiodo] [varchar](4) NULL,
	[ccampoextranumerico1] [float] NULL,
	[ccampoextranumerico2] [float] NULL,
	[ccampoextranumerico3] [float] NULL,
	[ccampoextranumerico4] [float] NULL,
	[ccampoextranumerico5] [float] NULL,
	[cdiastrabajados] [float] NULL,
	[cdiaspagados] [float] NULL,
	[cdiascotizados] [float] NULL,
	[cdiasausencia] [float] NULL,
	[cdiasincapacidades] [float] NULL,
	[cdiasvacaciones] [float] NULL,
	[cdiaspropseptimos] [float] NULL,
	[chorasextras1] [float] NULL,
	[chorasextras2] [float] NULL,
	[chorasextras3] [float] NULL,
	[cfechasueldomixto] [datetime] NULL,
	[csueldomixto] [float] NULL,
	[cfechacorte] [datetime] NULL,
 CONSTRAINT [PK_nom10034] PRIMARY KEY CLUSTERED 
(
	[idempleado] ASC,
	[idtipoperiodo] ASC,
	[cidperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXIDDEPTOEMPLEADOFECHA] ON [dbo].[nom10034] 
(
	[iddepartamento] ASC,
	[idempleado] ASC,
	[cfechacorte] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDEMPLEADOFECHA] ON [dbo].[nom10034] 
(
	[idempleado] ASC,
	[cfechacorte] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDPERIODOEMPLEADO] ON [dbo].[nom10034] 
(
	[cidperiodo] ASC,
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nomblobs](
	[username] [varchar](15) NULL,
	[codigoempleado] [varchar](40) NULL,
	[numero] [float] NULL
) ON [PRIMARY]



CREATE UNIQUE NONCLUSTERED INDEX [IDXCODIGOEMPLEADO] ON [dbo].[nomblobs] 
(
	[codigoempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10002](
	[idperiodo] [int] IDENTITY(1,1) NOT NULL,
	[idtipoperiodo] [int] NULL,
	[numeroperiodo] [int] NULL,
	[ejercicio] [int] NULL,
	[mes] [int] NULL,
	[diasdepago] [float] NULL,
	[septimos] [int] NULL,
	[interfazcheqpaqw] [bit] NOT NULL CONSTRAINT [DF_nom10002_interfazcheqpaqw]  DEFAULT ((0)),
	[modificacionneto] [bit] NOT NULL CONSTRAINT [DF_nom10002_modificacionneto]  DEFAULT ((0)),
	[calculado] [bit] NOT NULL CONSTRAINT [DF_nom10002_calculado]  DEFAULT ((0)),
	[afectado] [bit] NOT NULL CONSTRAINT [DF_nom10002_afectado]  DEFAULT ((0)),
	[fechainicio] [datetime] NULL,
	[fechafin] [datetime] NULL,
	[inicioejercicio] [bit] NOT NULL CONSTRAINT [DF_nom10002_inicioejercicio]  DEFAULT ((0)),
	[iniciomes] [bit] NOT NULL CONSTRAINT [DF_nom10002_iniciomes]  DEFAULT ((0)),
	[finmes] [bit] NOT NULL CONSTRAINT [DF_nom10002_finmes]  DEFAULT ((0)),
	[finejercicio] [bit] NOT NULL CONSTRAINT [DF_nom10002_finejercicio]  DEFAULT ((0)),
	[timestamp] [datetime] NULL,
	[cfinbimestreimss] [bit] NOT NULL CONSTRAINT [DF_nom10002_cfinbimestreimss]  DEFAULT ((0)),
	[ciniciobimestreimss] [bit] NOT NULL CONSTRAINT [DF_nom10002_ciniciobimestreimss]  DEFAULT ((0)),
 CONSTRAINT [PK_nom10002] PRIMARY KEY CLUSTERED 
(
	[idperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXIDEJERCICIO] ON [dbo].[nom10002] 
(
	[idtipoperiodo] ASC,
	[ejercicio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDEJERCICIOMES] ON [dbo].[nom10002] 
(
	[idtipoperiodo] ASC,
	[ejercicio] ASC,
	[mes] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDEJERCICIONUMERO] ON [dbo].[nom10002] 
(
	[idtipoperiodo] ASC,
	[ejercicio] ASC,
	[numeroperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDFECHAFIN] ON [dbo].[nom10002] 
(
	[idtipoperiodo] ASC,
	[fechafin] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDFECHAINICIO] ON [dbo].[nom10002] 
(
	[idtipoperiodo] ASC,
	[fechainicio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDFECHAS] ON [dbo].[nom10002] 
(
	[idtipoperiodo] ASC,
	[fechainicio] ASC,
	[fechafin] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDMESEJERCICIO] ON [dbo].[nom10002] 
(
	[idtipoperiodo] ASC,
	[mes] ASC,
	[ejercicio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDNUMERO] ON [dbo].[nom10002] 
(
	[idperiodo] ASC,
	[numeroperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDPERIODO] ON [dbo].[nom10002] 
(
	[idperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXNUMEROPERIODO] ON [dbo].[nom10002] 
(
	[numeroperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10005](
	[idempleado] [int] NOT NULL,
	[idconcepto] [int] NOT NULL,
 CONSTRAINT [PK_nom10005] PRIMARY KEY CLUSTERED 
(
	[idempleado] ASC,
	[idconcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXIDEMPLEADO] ON [dbo].[nom10005] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10006](
	[idpuesto] [int] IDENTITY(1,1) NOT NULL,
	[numeropuesto] [int] NULL,
	[descripcion] [varchar](40) NULL,
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10006] PRIMARY KEY CLUSTERED 
(
	[idpuesto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXDESCRIPCION] ON [dbo].[nom10006] 
(
	[descripcion] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXNUMEROPUESTO] ON [dbo].[nom10006] 
(
	[numeropuesto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10007](
	[idmovtopdo] [int] IDENTITY(1,1) NOT NULL,
	[idperiodo] [int] NULL,
	[idempleado] [int] NULL,
	[idconcepto] [int] NULL,
	[idmovtopermanente] [int] NULL,
	[importetotal] [float] NULL,
	[valor] [float] NULL,
	[importe1] [float] NULL,
	[importe2] [float] NULL,
	[importe3] [float] NULL,
	[importe4] [float] NULL,
	[importetotalreportado] [bit] NOT NULL CONSTRAINT [DF_nom10007_importetotalreportado]  DEFAULT ((0)),
	[importe1reportado] [bit] NOT NULL CONSTRAINT [DF_nom10007_importe1reportado]  DEFAULT ((0)),
	[importe2reportado] [bit] NOT NULL CONSTRAINT [DF_nom10007_importe2reportado]  DEFAULT ((0)),
	[importe3reportado] [bit] NOT NULL CONSTRAINT [DF_nom10007_importe3reportado]  DEFAULT ((0)),
	[importe4reportado] [bit] NOT NULL CONSTRAINT [DF_nom10007_importe4reportado]  DEFAULT ((0)),
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10007] PRIMARY KEY CLUSTERED 
(
	[idmovtopdo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXCONPEREMP] ON [dbo].[nom10007] 
(
	[idconcepto] ASC,
	[idperiodo] ASC,
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADO] ON [dbo].[nom10007] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOPERIODO] ON [dbo].[nom10007] 
(
	[idperiodo] ASC,
	[idempleado] ASC,
	[idconcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDPERIODO] ON [dbo].[nom10007] 
(
	[idperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXPERIODOCONCEPTO] ON [dbo].[nom10007] 
(
	[idperiodo] ASC,
	[idconcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10008](
	[idmovtopdo] [int] IDENTITY(1,1) NOT NULL,
	[idperiodo] [int] NULL,
	[idempleado] [int] NULL,
	[idconcepto] [int] NULL,
	[idmovtopermanente] [int] NULL,
	[importetotal] [float] NULL,
	[valor] [float] NULL,
	[importe1] [float] NULL,
	[importe2] [float] NULL,
	[importe3] [float] NULL,
	[importe4] [float] NULL,
	[importetotalreportado] [bit] NOT NULL CONSTRAINT [DF_nom10008_importetotalreportado]  DEFAULT ((0)),
	[importe1reportado] [bit] NOT NULL CONSTRAINT [DF_nom10008_importe1reportado]  DEFAULT ((0)),
	[importe2reportado] [bit] NOT NULL CONSTRAINT [DF_nom10008_importe2reportado]  DEFAULT ((0)),
	[importe3reportado] [bit] NOT NULL CONSTRAINT [DF_nom10008_importe3reportado]  DEFAULT ((0)),
	[importe4reportado] [bit] NOT NULL CONSTRAINT [DF_nom10008_importe4reportado]  DEFAULT ((0)),
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10008] PRIMARY KEY CLUSTERED 
(
	[idmovtopdo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXCONPEREMP] ON [dbo].[nom10008] 
(
	[idconcepto] ASC,
	[idperiodo] ASC,
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADO] ON [dbo].[nom10008] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOPERIODO] ON [dbo].[nom10008] 
(
	[idperiodo] ASC,
	[idempleado] ASC,
	[idconcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDPERIODO] ON [dbo].[nom10008] 
(
	[idperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXPERIODOCONCEPTO] ON [dbo].[nom10008] 
(
	[idperiodo] ASC,
	[idconcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10009](
	[idmovtodyh] [int] IDENTITY(1,1) NOT NULL,
	[idperiodo] [int] NULL,
	[idempleado] [int] NULL,
	[idtipoincidencia] [int] NULL,
	[idtarjetaincapacidad] [int] NULL,
	[idtcontrolvacaciones] [int] NULL,
	[fecha] [datetime] NULL,
	[valor] [float] NULL,
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10009] PRIMARY KEY CLUSTERED 
(
	[idmovtodyh] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXEMPLEADO] ON [dbo].[nom10009] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOFECHA] ON [dbo].[nom10009] 
(
	[idempleado] ASC,
	[fecha] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOFECHADESC] ON [dbo].[nom10009] 
(
	[idempleado] DESC,
	[fecha] DESC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOPERIODO] ON [dbo].[nom10009] 
(
	[idperiodo] ASC,
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDFECHA] ON [dbo].[nom10009] 
(
	[idperiodo] ASC,
	[fecha] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE UNIQUE NONCLUSTERED INDEX [IDXIDMOVTODYH] ON [dbo].[nom10009] 
(
	[idmovtodyh] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDPERIODO] ON [dbo].[nom10009] 
(
	[idperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDTARJETAINCAPACIDAD] ON [dbo].[nom10009] 
(
	[idtarjetaincapacidad] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDTCONTROLVACACIONES] ON [dbo].[nom10009] 
(
	[idtcontrolvacaciones] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXPEREMPINC] ON [dbo].[nom10009] 
(
	[idperiodo] ASC,
	[idempleado] ASC,
	[idtipoincidencia] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXPEREMPINCFEC] ON [dbo].[nom10009] 
(
	[idperiodo] ASC,
	[idempleado] ASC,
	[idtipoincidencia] ASC,
	[fecha] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10010](
	[idmovtodyh] [int] IDENTITY(1,1) NOT NULL,
	[idperiodo] [int] NULL,
	[idempleado] [int] NULL,
	[idtipoincidencia] [int] NULL,
	[idtarjetaincapacidad] [int] NULL,
	[idtcontrolvacaciones] [int] NULL,
	[fecha] [datetime] NULL,
	[valor] [float] NULL,
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10010] PRIMARY KEY CLUSTERED 
(
	[idmovtodyh] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXEMPLEADO] ON [dbo].[nom10010] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOFECHA] ON [dbo].[nom10010] 
(
	[idempleado] ASC,
	[fecha] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOFECHADESC] ON [dbo].[nom10010] 
(
	[idempleado] DESC,
	[fecha] DESC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOPERIODO] ON [dbo].[nom10010] 
(
	[idperiodo] ASC,
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDFECHA] ON [dbo].[nom10010] 
(
	[idperiodo] ASC,
	[fecha] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDPERIODO] ON [dbo].[nom10010] 
(
	[idperiodo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDTARJETAINCAPACIDAD] ON [dbo].[nom10010] 
(
	[idtarjetaincapacidad] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXIDTCONTROLVACACIONES] ON [dbo].[nom10010] 
(
	[idtcontrolvacaciones] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXPEREMPINC] ON [dbo].[nom10010] 
(
	[idperiodo] ASC,
	[idempleado] ASC,
	[idtipoincidencia] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXPEREMPINCFEC] ON [dbo].[nom10010] 
(
	[idperiodo] ASC,
	[idempleado] ASC,
	[idtipoincidencia] ASC,
	[fecha] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10021](
	[idtipoacumulado] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [varchar](40) NOT NULL,
	[tipomovtoacumulado] [varchar](1) NOT NULL,
	[timestamp] [datetime] NULL,
 CONSTRAINT [PK_nom10021] PRIMARY KEY CLUSTERED 
(
	[idtipoacumulado] ASC,
	[nombre] ASC,
	[tipomovtoacumulado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXNOMBRE] ON [dbo].[nom10021] 
(
	[nombre] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10011](
	[idempleado] [int] NOT NULL,
	[idtipoacumulado] [int] NOT NULL,
	[ejercicio] [int] NOT NULL,
	[importe1] [float] NULL,
	[importe2] [float] NULL,
	[importe3] [float] NULL,
	[importe4] [float] NULL,
	[importe5] [float] NULL,
	[importe6] [float] NULL,
	[importe7] [float] NULL,
	[importe8] [float] NULL,
	[importe9] [float] NULL,
	[importe10] [float] NULL,
	[importe11] [float] NULL,
	[importe12] [float] NULL,
	[importeinicioejercicio] [float] NULL,
	[importeejercicioanterior] [float] NULL,
 CONSTRAINT [PK_nom10011] PRIMARY KEY CLUSTERED 
(
	[idempleado] ASC,
	[idtipoacumulado] ASC,
	[ejercicio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXEJERCICIO] ON [dbo].[nom10011] 
(
	[ejercicio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADO] ON [dbo].[nom10011] 
(
	[idempleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXEMPLEADOEJERCICIO] ON [dbo].[nom10011] 
(
	[idempleado] ASC,
	[ejercicio] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10012](
	[idconcepto] [int] NOT NULL,
	[idtipoacumulado] [int] NOT NULL,
	[tipo] [varchar](1) NOT NULL,
 CONSTRAINT [PK_nom10012] PRIMARY KEY CLUSTERED 
(
	[idconcepto] ASC,
	[idtipoacumulado] ASC,
	[tipo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXIDCONCEPTO] ON [dbo].[nom10012] 
(
	[idconcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10013](
	[idtipoincidencia] [int] NOT NULL,
	[idtipoacumulado] [int] NOT NULL,
 CONSTRAINT [PK_nom10013] PRIMARY KEY CLUSTERED 
(
	[idtipoincidencia] ASC,
	[idtipoacumulado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10036](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[nombre] [varchar](30) NULL,
	[sentenciaSQL] [text] NULL,
	[activa] [bit] NULL CONSTRAINT [DF_nom10036_activa]  DEFAULT ((1)),
 CONSTRAINT [PK_nom10036] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10015](
	[idpoliza] [int] IDENTITY(1,1) NOT NULL,
	[idperiodo] [int] NULL,
	[estadocontab] [varchar](1) NULL,
	[fechapoliza] [datetime] NULL,
	[tipopoliza] [int] NULL,
	[numeropoliza] [int] NULL,
	[concepto] [varchar](100) NULL,
	[diario] [smallint] NULL,
 CONSTRAINT [PK_nom10015] PRIMARY KEY CLUSTERED 
(
	[idpoliza] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10016](
	[idmovtopoliza] [int] IDENTITY(1,1) NOT NULL,
	[idpoliza] [int] NULL,
	[cuentacw] [varchar](31) NULL,
	[numeromovto] [int] NULL,
	[referencia] [varchar](10) NULL,
	[concepto] [varchar](30) NULL,
	[tipomovto] [char](1) NULL,
	[cargo] [float] NULL,
	[abono] [float] NULL,
	[cargomonedaext] [float] NULL,
	[abonomonedaext] [float] NULL,
	[diario] [smallint] NULL,
	[csegmentonegocio] [int] NULL,
 CONSTRAINT [PK_nom10016] PRIMARY KEY CLUSTERED 
(
	[idmovtopoliza] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]



CREATE NONCLUSTERED INDEX [IDXPOLIZA] ON [dbo].[nom10016] 
(
	[idpoliza] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


CREATE NONCLUSTERED INDEX [IDXPOLIZACUENTATIPO] ON [dbo].[nom10016] 
(
	[idpoliza] ASC,
	[cuentacw] ASC,
	[tipomovto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

CREATE NONCLUSTERED INDEX [IDXPOLIZAMOVTO] ON [dbo].[nom10016] 
(
	[idpoliza] ASC,
	[numeromovto] ASC	
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10037](
	[IdDim] [int] NOT NULL,
	[IdConcepto] [int] NOT NULL,
 CONSTRAINT [PK_nom10037] PRIMARY KEY CLUSTERED 
(
	[IdDim] ASC,
	[IdConcepto] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[nom10038](
	[IDEmpleado] [int] NOT NULL,
	[IdConcepto] [int] NOT NULL,
	[Importe] [float] NOT NULL,
 CONSTRAINT [PK_nom10038] PRIMARY KEY CLUSTERED 
(
	[IDEmpleado] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


SET ANSI_NULLS ON

SET QUOTED_IDENTIFIER ON

CREATE TABLE [dbo].[VERSION](
	[versionBDD] [varchar](4)  NULL,
	[comentario] [varchar](40)  NULL,
	[firma] [varchar](10) NULL
) ON [PRIMARY]


if db_id('Predeterminada') is not null begin 
  if object_id('Predeterminada.dbo.nom10036') is not null begin
    insert into nom10036(nombre, sentenciaSQL, activa)
	select nombre, sentenciaSQL, activa from Predeterminada.dbo.nom10036
  end
end