multiplex77
Programmer
Hi,
I have a complex set of queries I need to invoke in order to get my desired record set, which I'm using a stored procedure for. I need to loop through the recordsets of the first select query, to analyze a second table, but don't know how to look at individual records of that record set.
If I'm using ASP, I would just do...
objRS.Open "SELECT table1_ID, Name1 FROM table1"
While Not objRS.EOF
objRS2.Open "SELECT * FROM table2 " & _
"WHERE ID = " & objRS("table1_ID"
& _
" Name = '" & objRS("Name1"
& "'"
objRS.MoveNext
Wend
However, using T-SQL, I don't know how to loop through resultsets. Could someone please help me?
Thanks very much, in advance.
...and then
I have a complex set of queries I need to invoke in order to get my desired record set, which I'm using a stored procedure for. I need to loop through the recordsets of the first select query, to analyze a second table, but don't know how to look at individual records of that record set.
If I'm using ASP, I would just do...
objRS.Open "SELECT table1_ID, Name1 FROM table1"
While Not objRS.EOF
objRS2.Open "SELECT * FROM table2 " & _
"WHERE ID = " & objRS("table1_ID"
" Name = '" & objRS("Name1"
objRS.MoveNext
Wend
However, using T-SQL, I don't know how to loop through resultsets. Could someone please help me?
Thanks very much, in advance.
...and then