Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Articles with tag cursors Rss

Search for any content tagged cursors

   Items 1 to 19 of 19   
 

A Case FOR Cursors...

We've all heard that definitive statement: "Avoid using cursors." But, in my opinion, what really should be conveyed is: "Avoid using row-by-row operations when possible."  Read more...
By Chris Jones 2015/06/01 | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 9,468 reads

Stairway to Advanced T-SQL Level 4: Record Level Processing Using Transact-SQL Cursors

Using a CURSOR is not normally the best way to process through a set of records. Yet when a seasoned programmer moves to writing TSQL for the first time they frequently look for ways to process a sets of records one row at a time. They do this because they are not used to thinking about processing records as a set. In order to process through a TSQL record set a row at a time you can use a cursor. A cursor is a record set that is defined with the DECLARE CURSOR statement. Cursors can be defined as either read-only or updatable. In this article I will introduce you to using cursors to do record level processing one row at a time.   Read more...
By Gregory Larsen 2015/05/06 | Source: SQLServerCentral.com | Category: stairway series
Rating: |  Discuss |   Briefcase | 4,859 reads

Performance Improvement for Cursors in Stored Procedures

Exploring some differences between using cursors, local fast forward cursors and using set logic.  Read more...
By Brian Hibbert 2015/02/03 | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 8,977 reads

Cursor-Killing: Retrieving Recently Modified Data

Cursors are considered by many to be the bane of good T-SQL. What are the best ways to avoid iterative T-SQL and to write queries that look and perform beautifully? In the next part of an ongoing series, we look at ways to efficiently retrieve recently modified data.  Read more...
By Edward Pollack 2014/06/02 | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 6,334 reads

Cursor-Killing: Accessing Data in the Next Row

Cursors are considered by many to be the bane of good T-SQL. What are the best ways to avoid iterative T-SQL and to write queries that look and perform beautifully? This first part in an ongoing series of cursor-killing handles inter-row analysis.  Read more...
By Edward Pollack 2014/05/27 | Source: SQLServerCentral.com | Category: cte
Rating: |  Discuss |   Briefcase | 12,098 reads

A simple T-SQL statement to create a list of lookup values

In this article, we provide a simple way to get a comma delimited list from a table of entries without having to use a CURSOR or a WHILE loop to read through the table.  Read more...
By Suresh G. Kumar 2012/09/28 (first published: 2011/03/21) | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 33,236 reads

Cursors for T-SQL Beginners

Should we really avoid cursors? See how to rewrite code to avoid cursors and also analyze the implications.   Read more...
By Wagner Crivelini 2011/05/27 (first published: 2009/01/01) | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 22,239 reads

A simple T-SQL statement to create a list of lookup values

In this article, we provide a simple way to get a comma delimited list from a table of entries without having to use a CURSOR or a WHILE loop to read through the table.  Read more...
By Suresh G. Kumar 2012/09/28 (first published: 2011/03/21) | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 33,236 reads

What Every DBA Ought to Know About SQL Server Cursors (and Their Alternatives)

Cursors provide a means of processing through a set of records row-by-row. However, many companies have a policy against using cursors in their SQL Server standards. This article examines the problem with cursors and alternatives to using them.  Read more...
By Additional Articles 2010/09/01 | Source: Database Journal | Category: cursors
Rating:  Rate this |   Briefcase | 4,694 reads

There Must Be 15 Ways To Lose Your Cursors… Part 2

Learn to use Where, Claire. Plus a conversion methodology, a test harness and more!  Read more...
By RBarry Young 2010/07/02 (first published: 2009/04/27) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 26,340 reads

There Must Be 15 Ways To Lose Your Cursors... part 1, Introduction

Learn how to leave those Cursors and loops in the thrash, Nash... An article from longtime contributor and SQL expert, Barry Young.  Read more...
By RBarry Young 2010/06/25 (first published: 2009/04/14) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 30,157 reads

Cursors Be Gone!

A short tutorial on converting cursors to more conventional loops.  Read more...
By Gaby Abed 2010/06/18 (first published: 2008/12/24) | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 36,984 reads

4 Ways to Increase Your Salary (Using UPDATE)

This article depicts how to approach row by row updates needed in a salary table. It might not directly let you increase your salary, but it could help you at review time.  Read more...
By Arup Chakraborty 2009/11/26 | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 7,926 reads

There Must Be 15 Ways To Lose Your Cursors… Part 2

Learn to use Where, Claire. Plus a conversion methodology, a test harness and more!  Read more...
By RBarry Young 2010/07/02 (first published: 2009/04/27) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 26,340 reads

There Must Be 15 Ways To Lose Your Cursors... part 1, Introduction

Learn how to leave those Cursors and loops in the thrash, Nash... An article from longtime contributor and SQL expert, Barry Young.  Read more...
By RBarry Young 2010/06/25 (first published: 2009/04/14) | Source: SQLServerCentral.com | Category: t-sql
Rating: |  Discuss |   Briefcase | 30,157 reads

Avoiding cursors with SQL Server 2005

Sometimes cursors are necessary when executing queries in SQL Server, but most of the time they can be avoided entirely. This article shows where cursors can traditionally be used, and how you can use features packaged in SQL Server 2005 to avoid them.  Read more...
By Additional Articles 2009/03/19 | Source: Builder.com | Category: cursors
Rating:  Rate this |   Briefcase | 5,440 reads

Cursors for T-SQL Beginners

Should we really avoid cursors? See how to rewrite code to avoid cursors and also analyze the implications.   Read more...
By Wagner Crivelini 2011/05/27 (first published: 2009/01/01) | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 22,239 reads

Cursors Be Gone!

A short tutorial on converting cursors to more conventional loops.  Read more...
By Gaby Abed 2010/06/18 (first published: 2008/12/24) | Source: SQLServerCentral.com | Category: cursors
Rating: |  Discuss |   Briefcase | 36,984 reads

SQL Server Cursor Examples

In my T-SQL code I always use set based operations. I have been told these types of operations are what SQL Server is designed to process and it should be quicker than serial processing. I know cursors exist but I am not sure how to use them. Can you provide some cursor examples?   Read more...
By Additional Articles 2008/10/21 | Source: MSSQLTips.com | Category: t-sql
Rating: (not yet rated)  Rate this |   Briefcase | 5,502 reads
   Items 1 to 19 of 19