日期:2014-05-17 浏览次数:20759 次
CREATE TABLE [dbo].[XXXXXX] ( [Objid] [int] IDENTITY(1, 1) NOT NULL , [Parentid] [int] NOT NULL , [Objname] [varchar](20) NULL , [Objjc] [varchar](50) NULL , [AFIRSTQ0001] [datetime] NULL , [ESECONDQ0722] [datetime] NULL , [ESECONDQ0914] [datetime] NULL , [ESECONDI0734] [int] NULL , [AFIRSTC0530] [varchar](1000) NULL , [AFIRSTC0003] [varchar](50) NULL , [AFIRSTC0557] [varchar](100) NULL , [AFIRSTQ2045] [datetime] NULL , [memo_PRE] AS ( CASE WHEN ( CHARINDEX('$$$',CONVERT(VARCHAR(1000), [memo])) > 0 ) THEN 1 ELSE 0 END ) , [AFIRSTQ0023] [datetime] NULL , [AFIRSTC0537] [varchar](100) NULL , [AFIRSTC2515] [varchar](255) NULL , [ESECONDI0003] [int] NULL , [WFPColor1] AS ( [dbo].[f_get](( -30 ), [AFIRSTQ2045], [OBJNAME],GETDATE()) ) , --就这里,需要先拆了,再加上. [ItemCount] AS ( [dbo].[f_get_I]([objexplain]) ) , CONSTRAINT [IX_WFPUSER_A0113] UNIQUE NONCLUSTERED ( [ESECONDQ0914] ASC ) WITH ( PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90 ) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
------解决方案--------------------
因为找个列引用了OBJNAME
[WFPColor1] AS ( [dbo].[f_get](( -30 ), [AFIRSTQ2045], [OBJNAME],GETDATE()) ) ,
需要把这一列先删除
然后在修改,然后在重建找个列
------解决方案--------------------
因含计算列,有依赖关系,
先备份数据,然后删除-重建表试试..
------解决方案--------------------
步骤:
步骤: ALTER TABLE XXXXXX DROP COLUMN WFPColor1 ALTER TABLE XXXXXX ALTER COLUMN Objname varchar(50) ALTER TABLE XXXXXX ALTER COLUMN Objname varchar(50) ALTER TABLE XXXXXX ADD WFPColor1 AS ( [dbo].[f_get](( -30 ), [AFIRSTQ2045], [OBJNAME],GETDATE()) )
------解决方案--------------------
ALTER TABLE XXXXXX DROP COLUMN WFPColor1 ALTER TABLE XXXXXX ALTER COLUMN Objname varchar(50) ALTER TABLE XXXXXX ALTER COLUMN Objname va