Hi,
This is a bit of code in one of the pages I am reviewing and trying to update. What I am trying to do is swap the inline query for stored procedures. This is the bit of code:
numOfDelRec = 1
Do While (numOfDelRec > 0)
cm.CommandText = "DELETE Folder WHERE FolderID IN
(SELECT ch.FolderID FROM Folder ch
LEFT JOIN Folder p ON ch.ParentID=p.FolderID " & _
"WHERE p.FolderID IS NULL AND ch.ParentID > 0)
AND UserID=" & Session("UserID")
cm.Execute numOfDelRec
Loop
What I am curious about is that the value numOfDelRec comes back and is used to continue looping, how do I basically do the same thing with a stored procedure, given that the stored procedure is basically the same as the inline sql?
This is my call to the stored procedure:
AuthConn.Execute("sp_MyFolder_DeleteFolder " & Session("UserID"))
This is Microsoft SQL Server 2005.
Thanks, R.