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

Content with tag cursors Rss

   Items 1 to 20 of 26    Older >>
 

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 | 8,909 reads

Global Cursors

By Steve Jones 2015/05/22 | Category: t-sql
Rating: (not yet rated) |  Discuss |   Briefcase | 1,409 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,504 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,845 reads

Virtual tally table function

An inline table-valued function (iTVF) that will produce a virtual tally table on-the-fly. The function creates a tally table of any size with user-defined lower and upper bounds.  Read more...
By Steven Willis 2014/09/08 | Source: SQLServerCentral.com | Category: tally
Rating: |  Discuss |   Briefcase | 1,975 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,326 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,086 reads

Right or Wrong, Dynamic SQL AND a Cursor

I'm no big fan of dynamic SQL or cursors, however there are times where they do the job.   Read more...
By Kurt Zimmerman 2013/11/08 | Category: transaction logs
Rating: |  Discuss |   Briefcase | 1,773 reads

Virtual tally table function

An inline table-valued function (iTVF) that will produce a virtual tally table on-the-fly. The function creates a tally table of any size with user-defined lower and upper bounds.  Read more...
By Steven Willis 2014/09/08 | Source: SQLServerCentral.com | Category: tally
Rating: |  Discuss |   Briefcase | 1,975 reads

Check Candidate Columns for NOT NULL Constraints

This script reports table columns that allow NULL values but that currently have no NULL values, making them candidates for adding a NOT NULL constraint.  Read more...
By Charles Jacobus 2013/01/23 | Source: SQLServerCentral.com | Category: data integrity
Rating: |  Discuss |   Briefcase | 664 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,229 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,218 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,229 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,671 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,290 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,092 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,966 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,290 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,092 reads
   Items 1 to 20 of 26    Older >>
 
Tags
t-sql (10)    
while loop (3)    
cte (2)    
dynamic sql (2)    
loop (2)    
performance tuning (2)    
advanced t-sql (1)    
alternative to cursors (1)    
blocking (1)    
counter (1)    
data generation (1)    
data integrity (1)    
datediff (1)    
deleted (1)    
execution plans (1)    
fetch (1)    
identity property (1)    
inserted (1)    
lag (1)    
lead (1)    
maintenance (1)    
merge (1)    
performance (1)    
performance improvement (1)    
random numbers (1)    
scope_identity (1)    
spid (1)    
stairway series (1)    
stored procedures (1)    
system view (1)    
table variables (1)    
tally (1)    
test data (1)    
transaction logs (1)    
while (1)    
window functions (1)