• laddu4700 (5/22/2011)


    Resolved.

    parent table column referring itself. that is why my sp is getting error nesting level exceeded (limit 32).

    I have modified SP and it worked

    WHERE SO2.Name = @cTableName and so1.name <> so2.name

    Thanks Lutz.

    "resolved" for today but you will be back at some point asking why this process is so horribly slow. At that point we will ask you again why you didn't just use referential integrity and cascading deletes instead of recreating a feature that is already available (and MUCH faster because it doesn't use cursors). You really should try to handle this with proper architecture instead of throwing more code at the problem. And by all means don't use a cursor for deletes. This looks like a generic delete procedure that will be called every time you want to delete something. Just my 2¢.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/