<p>Let's say I have the following simple table variable:</p>

<pre><code>declare @databases table
(
    DatabaseID    int,
    Name        varchar(15),   
    Server      varchar(15)
)
-- insert a bunch rows into @databases
</code></pre>

<p>Is declaring and using a cursor my only option if I wanted to iterate through the rows? Is there another way?</p>

You can use a while loop:
```
```
While (Select Count(*) From #TempTable) > 0
Begin
    Insert Into @Databases...

    Delete From #TempTable Where x = x
End
```
```