Groups | Blog | Home
all groups > sql server programming > january 2005 >

sql server programming : What cursor type do you use to retrieve multiple recordsets and Wh


Deepson Thomas
1/18/2005 10:53:01 PM

Can anybody help me to answer this question .. "What cursor type do you use
to retrieve multiple recordsets and Why ?" ....

Thanks in advance

--
David Gugick
1/19/2005 2:35:52 AM
[quoted text, click to view]

By cursor, I assume you mean a cursor as defined by ADO, or the like.
The type doesn't matter. Once you reach the end of one result set, you
can check the ADO recordset object to see if there are more results and
then start fetching through those. This can be a server or client-side
cursor as defined in ADO.

--
David Gugick
Imceda Software
www.imceda.com
Bob Barrows [MVP]
1/19/2005 6:58:25 AM
[quoted text, click to view]
Assuming you're taling about ADO, the documentation can be found here:
http://msdn.microsoft.com/library - drill down into the Win32 node to Data
Access. Or do a search for Connection Object.

According to the documentation, there is only one restriction:

********************************************************************************
As long as there are additional results and the Recordset containing the
compound statements is not disconnected or marshaled across process
boundaries, the NextRecordset method will continue to return Recordset
objects.
********************************************************************************

So, the ability to use NextRecordset is not effected by cursor type or
location. The only restriction is that the recordset remain connected to the
database in order to retrieve te next resultset.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

AddThis Social Bookmark Button