DECLARE @operacion as varchar(15) = 'CREATE'
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[reg_doc_prioridadDocumento]') AND type in (N'P', N'PC'))
BEGIN
	SET @operacion = 'ALTER'
END

execute(
 @operacion + ' PROCEDURE [dbo].[reg_doc_prioridadDocumento]
	@p_id INT
	AS
	BEGIN
	SELECT 	[id] AS [id],
		[uid] AS [uid],
		[eid] AS [eid],
		[id_usuario_modifico] AS [id_usuario_modifico],
		[id_usuario_creo] AS [id_usuario_creo],
		[fechaModificacion] AS [fechaModificacion],
		[fechaCreacion] AS [fechaCreacion],
		[active] AS [active],
		[prioridadDocumento] AS [prioridadDocumento],
		[prioridadDocumento_codigo] AS [prioridadDocumento_codigo],
		[tiempoRespuesta] AS [tiempoRespuesta],
		[id_tipoDocumento] AS [id_tipoDocumento],
		[id_estrategiaPrioridad] AS [id_estrategiaPrioridad],
		[orden] AS [orden]
	FROM [doc_prioridadDocumento]
	WHERE	(id = @p_id)
END
')