SET DATEFIRST 7
SET ANSI_NULLS OFF
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET LOCK_TIMEOUT -1
SET QUOTED_IDENTIFIER OFF
GO 

/**************** xpCA_CRMObtenerInspeccionAnexos ****************/
IF EXISTS (select * from sysobjects where id = object_id('dbo.xpCA_CRMObtenerInspeccionAnexos') and type = 'P') drop procedure dbo.xpCA_CRMObtenerInspeccionAnexos
GO
CREATE PROCEDURE xpCA_CRMObtenerInspeccionAnexos
@UUID varchar(36)
AS
BEGIN
	IF NOT EXISTS(SELECT FileUUID FROM CA_CRMInspeccionAnexos WHERE FileUUID = @UUID)
	BEGIN
		SELECT Ok = 0, OkRef = 'Error al obtener archivo'
		RETURN
	END

	SELECT Ruta + FileUUID + Tipo as Ruta FROM CA_CRMInspeccionAnexos WHERE FileUUID = @UUID
END
GO
