-----QUITA TABLAS Y PROC. DE FACTOR DE CALIDAD ANTERIOR ----
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[paQrytm_FCalidad]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[paQrytm_FCalidad]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[paInsFacCalidad]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[paInsFacCalidad]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[paUpFacCalidad]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[paUpFacCalidad]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tm_FCalidad]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[tm_FCalidad]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Trn_FacCalidad]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Trn_FacCalidad]
GO