Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Iterate A Table and execute statements

$
0
0

Hello,

  For each row in table X I need to write an T-SQL statement that deletes rows in 5 tables.  It should look something like this:

declare myInt =0

(foreach row in table x)

{

delete * from table y where rowId  = tablex.row

}


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>