IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[_agruparOtsXSol]') AND type in (N'P', N'PC'))DROP PROCEDURE [dbo].[_agruparOtsXSol]
GO
CREATE PROCEDURE [_agruparOtsXSol]
	@p_id_sol INT,
	@p_ots VARCHAR(max),
	@p_id_usuario INT
AS
BEGIN

	execute ('
		update doc_documento
		set 
			fechaModificacion = GETDATE(),
			id_usuario_modifico = ' + @p_id_usuario + ', 
			id_documento = ' + @p_id_sol + ' 
		where 
			id in (' + @p_ots + ')
	')
	select ''

END
