How to replace Cursor in SQL Server?

Let’s learn how to replace Cursor in SQL Server. The most accurate or helpful solution is served by

There are ten answers to this question.

Best solution

sql server - What are the different ways to replace a ...

I'd like to know your experience(s) with replacing SQL Server cursors in existing code, or how you took a problem that a procedural guy would use a cursor to solve ...

Other solutions

SQL Server Find and Replace Script

SQL SERVER - I'm not a SQL script guy, but I've got a SQL script problem. I'm trying to do a simply find-and-replace of a url wherever it may be in the db. The script I was given doesn't work, and the guy who wrote the script is gone. You can see the...


It looks like you're taking an awful lot of trouble to do what you could do with one statement: UPDATE...

Read more

jpoulos at Ask.Metafilter.Com Mark as irrelevant Undo

SQL Trace: How to aggregate data by stored procedure without ClearTrace

I'm trying to put together an automated SQL server monitoring and diagnostics solution, including SQL Trace data. I want to be able to group RPC:Completed event data by stored procedure. Unfortunately, the formatting and parameter values in each specific...


I don't know the answer. You might get a decent answer here. But for this kind of question, I think...

Read more

UrbanEye at Ask.Metafilter.Com Mark as irrelevant Undo

How do to update rows without a cursor?

How do I update rows in a table in a SQL*Server 2005 database with data from another row in the same table? I have an event log type table that contains data as follows: EVENT_TYPE START_TIME END_TIME type1 10 type3 4 type2 5 type1 11 type1 15 type2...


This should do the trick. It's the same as my first post, but I explicitly reference the table in the...

Read more

apark at Ask.Metafilter.Com Mark as irrelevant Undo

Pl sql problem cursor and functions?

how can you make a function or a procedure call a cursor? does this have to do with the ref cursors? can anyone help me with the whole syntax eg. (sorry, i'll be using some shortcuts on the code) create or replace function/procedure call_cursor BEGIN...


Not quite - think of the cursor as a temporary table. The DECLARE defines it, the OPEN populates it...

Read more

christian e at Yahoo! Answers Mark as irrelevant Undo

SQL/Python Program Help?

Hey all, I am working on a Python SQL program for school to search a query and then print results out on screen and then to a file, does this look good or what needs work? Thanks: # Connect to the SQL DB conn = adodbapi.connect("Provider=SQLDB ...


curs.execute('test_file') --> that's no SQL! try a valid sql statement to see if your db connection...

Read more

BDex at Yahoo! Answers Mark as irrelevant Undo


Sure it can be done... CREATE TABLE #T ( ID INT, [NAME] VARCHAR(50) ) INSERT #T SELECT 1, 'Row...

Read more Mark as irrelevant Undo


It really depends on the query, but the key is to find a set-based solution instead of using the row...

Read more

Grant Fritchey at Quora Mark as irrelevant Undo

SQL statement needed to create a variety of totals

I have an SQL Server Database that I need to create totals, but my SQL statement won't work. The table has a number of different areas that need to be grouped and then I need counts for the current month, previous month, year to date, and previous year...


Hi, softcom-ga: The short answer is that the conditional expression IIF is not part of Transact-SQL...

Read more

softcom-ga at Google Answers Mark as irrelevant Undo

When using PL/SQL objects i get a weird output...?



The only 'column' of OOAIRPORTS is of type airport_object. Since it's a structure instead of a regular...

Read more

Palak at Yahoo! Answers Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.