
ALTER PROCEDURE [dbo].[sel_doc_documento_otes_m]
	@p_eid as varchar (50)='',
	@p_filtro as varchar (max) = '1=1',
	@p_orden as varchar (8000) = 'id',
	@p_campos as varchar (8000) = '*' AS
BEGIN
exec ('SELECT '+ @p_campos +
' FROM [view_doc_documento_ot]
WHERE  (eid like '''+@p_eid+'%'+''' ) AND (' + @p_filtro + ') ORDER BY ' + @p_orden)
END