IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[userfunc_843_finddz_for_sql]') AND type = 'P')
DROP PROCEDURE [dbo].[userfunc_843_finddz_for_sql]
GO
CREATE PROCEDURE userfunc_843_finddz_for_sql(@cmpid int,   @branchid int,  @userdpid int,  @useruid int,   @userotid int,  @usersecurity int,@ctgid int,@ctgid2 int,@objid bigint,@param1 int)
as

BEGIN
select top 1 lgu_name
from mps_login_role where lgu_otid = 261 and lgu_dpid = @param1
END