
/****** Object:  StoredProcedure [dbo].[upd_seg_perfil]    Script Date: 10/12/2011 15:11:03 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[upd_seg_perfil]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[upd_seg_perfil]
GO

CREATE PROCEDURE [dbo].[upd_seg_perfil]
	@p_id int = null,
		@p_uid varchar(500) = null,
		@p_eid varchar(50) = null,
		@p_id_usuario_modifico int = null,
		@p_id_usuario_creo int = null,
		@p_fechaCreacion smalldatetime = null,
		@p_perfil varchar(300) = null,
		@p_perfil_codigo varchar(100) = null,
		@p_descripcion varchar(300) = null,
		@p_mostrarBotones bit = null,
		@p_paraCliente bit= null,
		@p_paraProveedor bit= null
AS
BEGIN
		UPDATE [seg_perfil]
		SET	[uid] = isnull(@p_uid,[uid]),
			[eid] = isnull(@p_eid,[eid]),
			[id_usuario_modifico] = isnull(@p_id_usuario_modifico,[id_usuario_modifico]),
			[id_usuario_creo] = isnull(@p_id_usuario_creo,[id_usuario_creo]),
			[fechaModificacion] = GETDATE(),
			[perfil] = isnull(@p_perfil,[perfil]),
			[perfil_codigo] = isnull(@p_perfil_codigo,[perfil_codigo]),
			[descripcion] = isnull(@p_descripcion,[descripcion]),
			[mostrarBotones] = isnull(@p_mostrarBotones,[mostrarBotones]),
			[paraCliente] = isnull(@p_paraCliente,[paraCliente]),
			[paraProveedor] = isnull(@p_paraProveedor,[paraProveedor])
		WHERE (id = @p_id)
END
