解决方法
在Sql2005数据库管理-->新建查询-->把脚本放进去选中执行,或者在在数据管理器-->指令操作-->把脚本放进去选中执行下面脚本:
USE [EMSXDB]
GO
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[CRM_CustomerSubLabelsView]'))
DROP VIEW [dbo].[CRM_CustomerSubLabelsView]
GO
CREATE VIEW [dbo].[CRM_CustomerSubLabelsView]
With ENCRYPTION
AS
Select
Convert(nvarchar(100),ShopCode)
as 连锁门店,
CASE Type
WHEN 1 THEN '固定标签'
WHEN 2 THEN '灵活标签'
ELSE '永久标签'
END as 标签类型,
Name as 标签名称,
[ExpireDate] as 失效日期,
Acc4ChargeUserName as 负责人员,
CRM_CustomerLabel.Id,
CRM_CustomerLabel.CustomerCode,
CRM_CustomerLabel.LabelSpecCode,
CRM_CustomerLabelSpec.Color,
CRM_CustomerLabelSpec.Type as LabSpecType,
CRM_CustomerLabel.Sys4CreateTime
From
CRM_CustomerLabel INNER JOIN
CRM_CustomerLabelSpec ON CRM_CustomerLabelSpec.Code = CRM_CustomerLabel.LabelSpecCode
Where
1=1
and ([ExpireDate]='' OR Convert(datetime,[ExpireDate]+' 23:59:59')>=getdate())
GO