IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[privateview_0]') AND type = 'V')
DROP VIEW [dbo].[privateview_0]
GO
CREATE VIEW [dbo].[privateview_0]
AS
select 
dp_id as objid,
dp_depart as '门店',
dp_bcid as '公司id'
from mps_depart 
where dp_status ='启用' 
and dp_isdepart = 1