-- 删除合同段SQL
UPDATE [dbo].[tb_Projects] SET ParentId='510321' WHERE ParentId='510322'
DELETE FROM [dbo].[tb_Projects] WHERE ProID='510322'
UPDATE [dbo].[tb_Projects] SET [Level]=[Level]-1 WHERE ProID > 510321
UPDATE [dbo].[tb_Projects]
SET ProjectCode = SUBSTRING(ProjectCode, 4, LEN(ProjectCode)-3)
FROM [dbo].[tb_Projects]
WHERE ProID > 510321