declare @Table table(
KnowledgeID nvarchar(50)
,KnowledgeName nvarchar(100)
,TypeID int
,StatusID int
,KeyWords nvarchar(200)
,ValidDate datetime
,RangeID int
,ClickNum int
,UseNum int
,BookNum int
,Score int
,CloseCode int
,AbolishFlag bit
,ModifyFlag bit
,SectID nvarchar(50)
,SectName nvarchar(50)
,ApproveStatus int
,ModifierID nvarchar(50)
,Modifer nvarchar(50)
,CreatorID nvarchar(50)
,Creator nvarchar(50)
,CreateTime datetime
,UpdateTime datetime
,SurfacePhenomenon varchar(MAX)
,StepContent varchar(MAX)
)
--todo .......
declare @SQL nvarchar(1200)
SET @SQL='select KnowledgeID from tbl_KbaKnowledgeCategory where OneLevelSortID='''+@OneLevelSortID+''''
IF LEN(@TwoLevelSortID)>0
SET @SQL=@SQL+' AND TwoLevelSortID='''+@TwoLevelSortID+''''
IF LEN(@ThreeLevelSortID)>0
SET @SQL=@SQL+' AND ThreeLevelSortID='''+@ThreeLevelSortID+''''
--将分类知识的编号填入临时表
insert into @Table(KnowledgeID) EXEC(@SQL)
---更新知识等级
update tbl_KbaKnowledge SET RangeID=@Level WHERE KnowledgeID IN (SELECT knowledgeID FROM @Table)
KnowledgeID nvarchar(50)
,KnowledgeName nvarchar(100)
,TypeID int
,StatusID int
,KeyWords nvarchar(200)
,ValidDate datetime
,RangeID int
,ClickNum int
,UseNum int
,BookNum int
,Score int
,CloseCode int
,AbolishFlag bit
,ModifyFlag bit
,SectID nvarchar(50)
,SectName nvarchar(50)
,ApproveStatus int
,ModifierID nvarchar(50)
,Modifer nvarchar(50)
,CreatorID nvarchar(50)
,Creator nvarchar(50)
,CreateTime datetime
,UpdateTime datetime
,SurfacePhenomenon varchar(MAX)
,StepContent varchar(MAX)
)
--todo .......
declare @SQL nvarchar(1200)
SET @SQL='select KnowledgeID from tbl_KbaKnowledgeCategory where OneLevelSortID='''+@OneLevelSortID+''''
IF LEN(@TwoLevelSortID)>0
SET @SQL=@SQL+' AND TwoLevelSortID='''+@TwoLevelSortID+''''
IF LEN(@ThreeLevelSortID)>0
SET @SQL=@SQL+' AND ThreeLevelSortID='''+@ThreeLevelSortID+''''
--将分类知识的编号填入临时表
insert into @Table(KnowledgeID) EXEC(@SQL)
---更新知识等级
update tbl_KbaKnowledge SET RangeID=@Level WHERE KnowledgeID IN (SELECT knowledgeID FROM @Table)