Wrox Programmer Forums
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 8th, 2006, 03:57 AM
Authorized User
Join Date: Sep 2006
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Regarding Cursor

Hi Everybody

  Can any body tell me the differnce beetween Client-Side Cursor and Server-Side Cursor.

Thanking you ,

Old September 8th, 2006, 10:03 AM
Authorized User
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts

Hi Param!

Few defintions from BOL >>

client cursor :
In a client cursor, a default result set is used to cache the entire result set on the client and all cursor operations are performed against this client cache. None of the server cursor functionality of Microsoft SQL Server 2000 is used. Client cursors support only forward-only and static cursors, not keyset-driven or dynamic cursors.

Server cursor :
A cursor implemented on the server. The cursor itself is built at the server, and only the rows fetched by an application are sent to the client. This cursor would not use the client cache.

Server Cursors vs. Client Cursors

There are several advantages to using server cursors instead of client cursors:

If you are going to access a fraction of the data in the cursor (typical of many browsing applications), using server cursors provides optimal performance because only fetched data is sent over the network. Client cursors cache the entire result set on the client.

Additional cursor types
If the SQL Server ODBC driver used only client cursors, it could support only forward-only and static cursors. By using API server cursors the driver can also support keyset-driven and dynamic cursors. SQL Server also supports the full range of cursor concurrency attributes only through server cursors. Client cursors are limited in the functionality they support.

More accurate positioned updates
Server cursors directly support positioned operations, such as the ODBC SQLSetPos function or UPDATE and DELETE statements with the WHERE CURRENT OF clause. Client cursors, on the other hand, simulate positioned cursor updates by generating a Transact-SQL searched UPDATE statement, which leads to unintended updates if more than one row matches the WHERE clause conditions of the UPDATE statement.

Memory usage
When using server cursors, the client does not need to cache large amounts of data or maintain information about the cursor position because the server does that.

Multiple active statements
When using server cursors, no results are left outstanding on the connection between cursor operations. This allows you to have multiple cursor-based statements active at the same time.

I think this content is enough to understand. For further enquiries mail me at - sqldba4u@yahoo.com

-Som Dutt

Similar Threads
Thread Thread Starter Forum Replies Last Post
Magnetic Cursor - Target Area Cursor? gcarcass .NET Framework 2.0 1 May 5th, 2008 07:20 AM
cursor parameters??? evaldesc SQL Server 2000 8 July 28th, 2007 02:53 PM
Regarding Cursor param99 SQL Language 0 September 8th, 2006 03:56 AM
concat 2 different cursor sreekesh ADO.NET 0 August 18th, 2006 07:11 AM
cursor trinnie SQL Server 2000 0 August 6th, 2006 09:55 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.