IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[userfunc_751_get_stores]') AND type = 'P')
DROP PROCEDURE [dbo].[userfunc_751_get_stores]
GO
CREATE PROCEDURE userfunc_751_get_stores(@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 store,[门店号] as store2
   FROM [DBTC].[datas].[dbo].[dd_zbgl_date]
   where [门店号] in (select dp_code  from  mps_depart where  dp_mcuid1 = @useruid)


end