Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 How to make a loop or procedure inside stored procedure to use...

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-10-15 : 08:08:24
Pial writes "I want to do the same job in stored procedure as the following function does in ASP-
Function DelTree(tId)
call datalink
sql="select Id,rootId,listOrd from tree where parentId="&tId
rs.open sql,conn,0,1
if not rs.eof then
dim tmpId
dim tmprootId
dim tmplistOrd
tmpId=rs("Id")
tmprootId=rs("rootId")
tmplistOrd=rs("listOrd")

sql="DELETE FROM tree WHERE parentId="&tId
conn.execute(sql)
Response.Write "UPDATE tree SET listOrd=listOrd-1 WHERE rootId="& tmprootId &" And listOrd>"& tmplistOrd
conn.execute("UPDATE tree SET listOrd=listOrd-1 WHERE rootId="& tmprootId &" And listOrd>"& tmplistOrd)
DelTree(tmpId)
end if
End Function"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-10-15 : 09:27:34
What have you tried so far? This seems pretty straight forward...

Jay White
{0}
Go to Top of Page
   

- Advertisement -