Loops in SQL?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Josiah Mahon

    Loops in SQL?

    I'm making a stored procedure in SQL to work in some C# code I'm doing. The stored procedure's job is to find all rows in a table in which another table's ID exists, then get some column values for those selected rows, followed by inputting new data into the table using the same values I just selected. In anything but SQL, I would probably use a for loop to do this (because the initial select statement is returning multiple values, and I need to do something different for each value returned), but from my research online, it seems that a for loop in SQL is not gonna happen. What is the best way to do this?
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Could you provide an example to make this problem a little clearer?

    Comment

    Working...