Monday, March 14, 2005
Delete a SubTree
/*
Delete a subtree from the hierarchy
*/
CREATE PROC dbo.deleteSubTree
(@EmpId int)
AS
BEGIN
SET NOCOUNT ON
DECLARE @Hkey bigint
SELECT @Hkey = Hkey
FROM EmpHierarchy
WHERE EmpId = @EmpId
DELETE FROM EmpHierarchy
WHERE Path % @Hkey = 0
END
/*
Delete a subtree from the hierarchy
*/
CREATE PROC dbo.deleteSubTree
(@EmpId int)
AS
BEGIN
SET NOCOUNT ON
DECLARE @Hkey bigint
SELECT @Hkey = Hkey
FROM EmpHierarchy
WHERE EmpId = @EmpId
DELETE FROM EmpHierarchy
WHERE Path % @Hkey = 0
END
Comments:
<< Home
free themeforest templates from Template Plaza. If you need it, just cheek link and I'll pm you direct download link.
www.templatedesk.com
Post a Comment
www.templatedesk.com
<< Home