SGBD
Enviado por Tony3848 • 26 de Febrero de 2023 • Apuntes • 13.437 Palabras (54 Páginas) • 41 Visitas
/*==============================================================*/
/* DBMS name: Microsoft SQL Server 2008 */
/* Created on: 3/8/2022 20:03:23 */
/*==============================================================*/
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('BARRIO') and o.name = 'FK_BARRIO_PARROQUIA_PARROQUI')
alter table BARRIO
drop constraint FK_BARRIO_PARROQUIA_PARROQUI
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('CANTON') and o.name = 'FK_CANTON_PROVINCIA_PROVINCI')
alter table CANTON
drop constraint FK_CANTON_PROVINCIA_PROVINCI
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('CARGO_TRABAJADOR') and o.name = 'FK_CARGO_TR_EMPLEADO__EMPLEADO')
alter table CARGO_TRABAJADOR
drop constraint FK_CARGO_TR_EMPLEADO__EMPLEADO
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('CLIENTES') and o.name = 'FK_CLIENTES_MECANICA__MECANICA')
alter table CLIENTES
drop constraint FK_CLIENTES_MECANICA__MECANICA
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('DETALLE_FACTURA') and o.name = 'FK_DETALLE__FACTURA_D_FACTURA')
alter table DETALLE_FACTURA
drop constraint FK_DETALLE__FACTURA_D_FACTURA
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('DETALLE_FACTURA_PROVEEDOR') and o.name = 'FK_DETALLE__FACTURA_D_FACTURA_')
alter table DETALLE_FACTURA_PROVEEDOR
drop constraint FK_DETALLE__FACTURA_D_FACTURA_
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('EMPLEADOS_CONTRATADO') and o.name = 'FK_EMPLEADO_EMPLEADO__JORNADA_')
alter table EMPLEADOS_CONTRATADO
drop constraint FK_EMPLEADO_EMPLEADO__JORNADA_
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('EMPLEADOS_CONTRATADO') and o.name = 'FK_EMPLEADO_MECANICA__MECANICA')
alter table EMPLEADOS_CONTRATADO
drop constraint FK_EMPLEADO_MECANICA__MECANICA
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('ESTADO_CIVIL') and o.name = 'FK_ESTADO_C_CLIENTE_E_CLIENTES')
alter table ESTADO_CIVIL
drop constraint FK_ESTADO_C_CLIENTE_E_CLIENTES
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('ESTADO_CIVIL') and o.name = 'FK_ESTADO_C_EMPLEADO__EMPLEADO')
alter table ESTADO_CIVIL
drop constraint FK_ESTADO_C_EMPLEADO__EMPLEADO
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('FACTURA') and o.name = 'FK_FACTURA_FACTURA_C_CLIENTES')
alter table FACTURA
drop constraint FK_FACTURA_FACTURA_C_CLIENTES
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('FACTURA') and o.name = 'FK_FACTURA_MECANICA__MECANICA')
alter table FACTURA
drop constraint FK_FACTURA_MECANICA__MECANICA
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('FACTURA_PROVEEDOR') and o.name = 'FK_FACTURA__PROVEEDOR_PROVEEDO')
alter table FACTURA_PROVEEDOR
drop constraint FK_FACTURA__PROVEEDOR_PROVEEDO
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('HORARIO_CARGO') and o.name = 'FK_HORARIO__HORARIO_C_HORARIO_')
alter table HORARIO_CARGO
drop constraint FK_HORARIO__HORARIO_C_HORARIO_
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('HORARIO_CARGO') and o.name = 'FK_HORARIO__HORARIO_C_CARGO_TR')
alter table HORARIO_CARGO
drop constraint FK_HORARIO__HORARIO_C_CARGO_TR
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('HORARIO_EMPLEADO') and o.name = 'FK_HORARIO__JORNADA_T_JORNADA_')
alter table HORARIO_EMPLEADO
drop constraint FK_HORARIO__JORNADA_T_JORNADA_
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('MECANICO') and o.name = 'FK_MECANICO_CARGO_MEC_CARGO_TR')
alter table MECANICO
drop constraint FK_MECANICO_CARGO_MEC_CARGO_TR
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('NACIONALIDAD') and o.name = 'FK_NACIONAL_CLIENTE_N_CLIENTES')
alter table NACIONALIDAD
drop constraint FK_NACIONAL_CLIENTE_N_CLIENTES
...