Running Stored Procedure with parameters resulting from query
Posted
by David in Dakota
on Stack Overflow
See other posts from Stack Overflow
or by David in Dakota
Published on 2010-04-05T21:16:43Z
Indexed on
2010/04/05
21:23 UTC
Read the original article
Hit count: 353
It's not hard to find developers who think cursors are gauche but I am wondering how to solve the following problem without one:
Let's say I have a proc called uspStudentDelete that takes as a parameter @StudentID.
uspStudentDelete applies a bunch of cascading soft delete logic, marking a flag on tables like "classes", "grades", and so on as inactive. uspStudentDelete is well vetted and has worked for some time.
What would be the best way to run uspStudentDelete on the results of a query (e.g. select studentid from students where ... ) in *TSQL*?
© Stack Overflow or respective owner