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



   set nocount on
   SELECT distinct [区域] as area,[区域] as area2
   FROM [DBTC].[datas].[dbo].[dd_zbgl_date]
   where [门店号] in (select dp_code  from  mps_depart where  dp_mcuid2 = @useruid)


end