dbo.led_empleados_periodo

Description

Properties

Name Value
File Collation
File Group
Filestream File Group
Is Partitioned

False

Partitioned Column
Partition Scheme
File Groups
Filestream Partition Scheme
Filestream File Groups
Heap

True

Full Text Catalog
Full Text
Compression NONE
Row Count (~) 3149914
Created 12/29/2015 4:57:46 PM
Last Modified 11/29/2024 5:15:57 PM

Columns

10
Key Name Data Type Length Precision Scale Not Null Identity Rule Default Computed Persisted Description
empleado int 4 10 0

True

False

False

contratista int 4 10 0

False

False

False

tipo_alta tinyint 1 3 0

False

False

False

tipo_baja tinyint 1 3 0

False

False

False

periodo int 4 10 0

True

False

False

contratista_1 int 4 10 0

False

False

False

fecha_afectacion datetime 8 23 3

False

(getdate())

False

False

ratificado tinyint 1 3 0

False

(0)

False

False

ratificado_por int 4 10 0

False

False

False

fecha_ratificado datetime 8 23 3

False

False

False

Indexes

7
Key Name Columns Unique Type Description
idx_Empleados_Periodo contratista, periodo

False

idxEmpleadoCompliance periodo

False

idxEmpleAfectacion fecha_afectacion

False

idxImperiumEmplePeriodo contratista, periodo

False

idxLedEmplePeriodosImper periodo, fecha_afectacion

False

NonClusteredIndex-20160817-145046 empleado, contratista, tipo_alta, tipo_baja, periodo

True

XPKled_empleados_periodo empleado, periodo

True

Triggers

1
Name ANSI Nulls ON Quoted Identifier ON On Not For Replication Description
led_empleados_periodo_INS

True

True

AFTER INSERT

False

SQL Script

Copy
CREATE TABLE dbo.led_empleados_periodo (
  empleado int NOT NULL,
  contratista int NULL,
  tipo_alta tinyint NULL,
  tipo_baja tinyint NULL,
  periodo int NOT NULL,
  contratista_1 int NULL,
  fecha_afectacion datetime NULL DEFAULT (getdate()),
  ratificado tinyint NULL DEFAULT (0),
  ratificado_por int NULL,
  fecha_ratificado datetime NULL,
  CONSTRAINT XPKled_empleados_periodo PRIMARY KEY NONCLUSTERED (empleado, periodo) WITH (FILLFACTOR = 90)
)
ON [PRIMARY]
GO

CREATE INDEX idx_Empleados_Periodo
  ON dbo.led_empleados_periodo (contratista, periodo)
  WITH (FILLFACTOR = 80)
  ON [PRIMARY]
GO

CREATE INDEX idxEmpleadoCompliance
  ON dbo.led_empleados_periodo (periodo)
  INCLUDE (empleado, contratista, tipo_alta, tipo_baja, contratista_1)
  WITH (FILLFACTOR = 80)
  ON [PRIMARY]
GO

CREATE INDEX idxEmpleAfectacion
  ON dbo.led_empleados_periodo (fecha_afectacion)
  INCLUDE (empleado)
  WITH (FILLFACTOR = 80)
  ON [PRIMARY]
GO

CREATE INDEX idxImperiumEmplePeriodo
  ON dbo.led_empleados_periodo (contratista, periodo)
  INCLUDE (contratista_1)
  WITH (FILLFACTOR = 80)
  ON [PRIMARY]
GO

CREATE INDEX idxLedEmplePeriodosImper
  ON dbo.led_empleados_periodo (periodo, fecha_afectacion)
  INCLUDE (empleado, contratista, contratista_1)
  WITH (FILLFACTOR = 80)
  ON [PRIMARY]
GO

CREATE UNIQUE INDEX [NonClusteredIndex-20160817-145046]
  ON dbo.led_empleados_periodo (empleado, contratista, tipo_alta, tipo_baja, periodo)
  WITH (FILLFACTOR = 80)
  ON [PRIMARY]
GO

SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE OR ALTER TRIGGER dbo.led_empleados_periodo_INS ON led_empleados_periodo AFTER INSERT 
AS
BEGIN
  SET NOCOUNT ON

  UPDATE led_empleados_periodo SET fecha_afectacion = getdate()
    FROM INSERTED,led_empleados_periodo
    WHERE led_empleados_periodo.empleado = INSERTED.empleado and led_empleados_periodo.periodo = inserted.periodo 
 AND INSERTED.fecha_afectacion IS NULL

  SET NOCOUNT OFF
END
GO

Depends On

No items found

Used By

128