August 4, 2010 at 12:09 am
ALTER procedure DeleteNLevelData
@Id int
as
WITH CatTB(id)
AS
(
SELECT Id
FROM tblCategory
WHERE Id = @Id
UNION ALL
SELECT C.Id
FROM tblCategory AS C
JOIN CatTB AS CT
ON C.ParentId = CT.Id
)
delete from tblCategory where Id in
(
SELECT Id FROM CatTB
)
August 4, 2010 at 9:04 pm
Is there a question here?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
August 4, 2010 at 9:26 pm
You can't use a CTE in SQL 7/2000 (which is the forum that you posted in).
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply