我在保存程序中执行该目标时,没有错误的物体。 谁能让我知道为什么呢?
我的错误信息是:
Msg 208, Level 16, State 1, Procedure SubSkillDelete, Line 47
Invalid object name SubSkillIds .
法典:
WITH SubSkillIds (SubSkillId) AS
(
-- Base case
SELECT
SubSkillId
FROM dbo.SubSkill
WHERE RegressionSubSkillId = @SubSkillId
UNION ALL
-- Recursive step
SELECT
S.SubSkillId
FROM dbo.SubSkill S
WHERE S.RegressionSubSkillId IN (
SELECT
SubSkillId
FROM dbo.SubSkill
WHERE RegressionSubSkillId = @SubSkillId)
)
SELECT @SubSkillIdFound = SubSkillId
FROM SubSkill WHERE SubSkillId = @SubSkillId
DELETE FROM SubSkillActivity WHERE SubSkillId = @SubSkillId
DELETE FROM SubSkill WHERE RegressionSubSkillId
IN (SELECT * FROM SubSkillIds)
DELETE FROM SubSkill WHERE SubSkillId = @SubSkillId