About 68 results
Open links in new tab
  1. How do I loop through a set of records in SQL Server?

    224 How do I loop through a set of records from a select statement? Say I have a few records that I wish to loop through and do something with each record. Here's a primitive version of my …

  2. sql server - Is there a way to loop through a table variable in TSQL ...

    declare @databases table ( DatabaseID int, Name varchar(15), Server varchar(15) ) -- insert a bunch rows into @databases Is declaring and using a cursor my only option if I wanted to …

  3. How can I loop through all rows of a table? (MySQL)

    Since the suggestion of a loop implies the request for a procedure type solution. Here is mine. Any query which works on any single record taken from a table can be wrapped in a procedure …

  4. How do I Loop through a table and update a field in SQL

    Feb 18, 2017 · How do I Loop through a table and update a field in SQL Ask Question Asked 8 years, 9 months ago Modified 8 years, 9 months ago

  5. SQL - Iterating through table records - Stack Overflow

    May 17, 2013 · ID -- 1 2 3 4 In reality, I want to iterate through each of the rows in this table. However, I cannot figure out how to do this. Can someone show me some sample SQL ...

  6. sql loop through each row in a table - Stack Overflow

    Can't really picture what you're after, but to answer the question in your subject line, you loop through the rows in a table with a CURSOR.

  7. sql - How to iterate over results of query - Stack Overflow

    I am creating a function in pgsql script language, and what I want to do in this point is iterate over the results of a query and for each row do something specific. My current try is the following,

  8. sql server - T-SQL - What's the most efficient way to loop through …

    May 28, 2018 · T-SQL - What's the most efficient way to loop through a table until a condition is met Ask Question Asked 7 years, 6 months ago Modified 7 years, 6 months ago

  9. Loop through a recordset and use the result to do another SQL …

    Mar 8, 2013 · Then loop through this record set. Let's say I pass in SomeID = 35. So, the record set will return 2 records with SomeID 35. In the loop, I will get ProductID 8 and 11, which will …

  10. SQL Loop through records in a table - Stack Overflow

    My familiarity with SQL scripting is very limited - I know how I would do it in other languages but my uncertainty lies in how to ensure that I'm looking at each record in the table and performing …