
begin try 

begin transaction

CREATE LOGIN SYSDBA WITH PASSWORD = 'masterkey';

CREATE USER SYSDBA FOR LOGIN SYSDBA WITH DEFAULT_SCHEMA = dbo;

GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ACCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ACTIVIDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  AGENDA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  AGENTE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  AGRUPACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ANORMALIDAD_CALCULO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  APLICA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  APP_MOBILE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  AUDITORIA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  AUTORIZACION_HE_PER TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  AUTORIZACION_HORAS_EXTRAS TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CAMARA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CATEGORIA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  COMEDOR_MENU_AUTOMATICO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CONCEPTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CONCEPTO_PROCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CONFIGURACION_MONITOR TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CONSUMO_MENU TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CONSUMO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CONTROL_ACTIVIDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CONVENIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  CONVERSION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  DATO_PERMANENCIA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  DEPURAR_LOG TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  DOCUMENTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  EMPRESA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ENVIO_REPORTE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ERROR_TECNICO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ESTADO_ACTIVIDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ESTADO_AGENDA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ESTADO_AUTORIZACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ESTADO_CAMARA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ESTADO_MENSAJE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ESTADO_NOVEDAD_ACCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ESTADO_PROCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ESTADO_REGISTRACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  EXPOINDSAL TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  EXTENCION_PERIODO_FLEXIBLE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  FECHA_JORNADA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  FERIADO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  FICHADA_PROCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  FORMATO_CONCEPTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  FORMATO_EXPO_NOVEDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  FORMATO_SALIDA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  FORMATO_SINCRONIZACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  GEOLOCALIZACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  GRUPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  HORARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  HORARIO_CONTROL_PERSONAL TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  HUELLA_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  IDIOMA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  IDS_CONSOLA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  INICIO_ACTIVIDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  JORNADA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  JORNADA_CALENDARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  JUSTIFICACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  LECTURA_AUTOMATICA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  LISTA_PRECIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  LOG_AGENTE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  LOTE_AGENTE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  MENSAJE_USUARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  MENU TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  MODO_CAMARA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  MODO_TARJETA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  MODULO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  NOVEDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  NOVEDAD_ACCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  NOVEDAD_EXPORTACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  OPCION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  OPERACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_ACCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_AD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_COMEDOR TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_EXPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_GENERAL TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_HORARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_IMPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_MOBILE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_NOVEDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_PROCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PARAMETRO_WORKFLOW TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PERFIL TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PERFIL_ACCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PERIODO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PERSONA_COMEDOR TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PERSONA_HORARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PERSONA_MOBILE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_CATEGORIA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_CONVENIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_CONVERSION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_EXT_PER_FLEX TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_EXT_PER_FLEX_INDIV TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_FERIADO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_FORMATO_CONCEPTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_GRUPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_HOR_CON_PER TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_JORNADA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_JORNADA_CALENDARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_JORNADA_INDIV TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_JUSTIFICACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_NOVEDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_PERIODO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_PERIODO_INDIV TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_PERSONA_HORARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_CATEGORIA_CONCEPTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_CONVENIO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_CONVERSION_CONVENIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_F_CONC_CONV_DES TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_F_CONC_CONV_ORI TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_GRUPO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_JOR_CON_FOR TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_JOR_CON_FOR_INDIV TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_JUSTIFICACION_TIPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_NOVEDAD_GRUPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_NOVEDAD_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_PER_CON_INDIV TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_PERIODO_CONCEPTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_REL_PERSONA_CATEGORIA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PRO_RETICULA_CALENDARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_GRUPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PER_JOR_DOC TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PER_JOR_NOV TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PER_JOR_CNV TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PERSONA_JORNADA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_CATEGORIA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_CONVENIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_CONVERSION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_EXT_PER_FLEX TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_FERIADO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_FORMATO_CONCEPTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_GRUPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_HOR_CON_PER TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_JORNADA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_JORNADA_CALENDARIO TO SYSDBA;  
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_JUSTIFICACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_NOVEDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_PERIODO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_PERSONA_HORARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_CAT_CONCEPTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_CONV_PERS TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_CVER_CVENIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_FC_CV_DES TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_FC_CV_ORI TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_GRUPO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_JOR_CON_FOR TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_JUSTIF_TIPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_NOV_PER TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_NOVEDAD_GRUPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_PERI_CONC TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_REL_PERS_CATEG TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROCESO_PRO_RET_CAL TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  PROTOCOLO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REFERENCIA_SUB_PERIODO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REGISTRACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REGISTRO_ACTIVIDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_ACCESO_RELOJ TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_CAMARA_RELOJ TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_CATEGORIA_CONCEPTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_CONVENIO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_CONVERSION_CONVENIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_EMPRESA_MODULO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_ENVIO_REPORTE_ACCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_ENVIO_REPORTE_COMEDOR TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_ENVIO_REPORTE_COMUNICACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_ENVIO_REPORTE_HORARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_ENVIO_REPORTE_USUARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_F_CONCEPTO_CONVERSION_DES TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_F_CONCEPTO_CONVERSION_ORI TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_FORMATO_CONCEPTO_GRUPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_GRP_PRM_AD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_GRUPO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_GRUPO_USUARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_JORNADA_CONCEPTO_FORMATO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_JUSTIFICACION_TIPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_LISTA_PRECIO_MENU TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_NOTIFICACION_MONITOR TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_NOV_ACCESO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_NOVEDAD_DOCUMENTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_NOVEDAD_GRUPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_NOVEDAD_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_NOVEDAD_USUARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_OPCION_OPERACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_PERFIL_OPCION_OPERACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_PERFIL_RELOJ_HORARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_PERIODO_CONCEPTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_PERSONA_CATEGORIA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_PERSONA_COMEDOR_MENU TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_PERSONA_GEOLOCALIZACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_PERSONA_RELOJ TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_RELOJ_MONITOR TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_RELOJ_USUARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_RELOJ_ZONA_APB TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REL_VENCIMIENTO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  RELOJ TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REPORTE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REPORTE_ACCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REPORTE_COMEDOR TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REPORTE_COMUNICACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  REPORTE_HORARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  RESERVA_LICENCIA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  RESOLUCION_CAMARA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  RETICULA_CALENDARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  SINCRONIZACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  SINCRONIZACION_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  SUB_PERIODO_DETALLE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  SUBMENU TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TARJETA_HISTORICO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_ACCESO_RELOJ TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_AGENTE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_ASIGNACION_GRUPO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_ASIGNACION_RELOJ TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_AUTORIZACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_COMANDO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_COMUNICACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_DOCUMENTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_EJEC_SINC TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_EJECUCION_AGENTE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_EJECUCION_PROCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_ENVIO_REPORTE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_ERROR_TECNICO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_HORARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_INCONSISTENCIA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_JUSTIFICACION TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_NOVEDAD TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_NOVEDAD_ACCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_PERSONA TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_PROCESO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_REGISTRO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  TIPO_RELOJ TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  USUARIO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  VENCIMIENTO TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ZONA_APB TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ZONA_PRESENTE TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ZONA_PRESENTE_RELOJ TO SYSDBA;
GRANT  SELECT ,  UPDATE ,  INSERT ,  DELETE  ON  ZONA_PRESENTE_CONF_MONITOR TO SYSDBA;

commit tran

end try
begin catch 
	if @@trancount > 0
		begin
			SELECT ERROR_MESSAGE() AS ErrorMessage, ERROR_LINE() AS Linea;
			rollback tran
		end
end catch
