Cursor issue in 2012 v 2008r2

Hi there,  we're executing the same stored procedure against identical databases on sql 2008r2 and 2012.

The sp contains a cursor and runs quickly (3 mins) on 2008r2, yet continues to run on 2012.

We've checked everything in terms of hardware, network, config and can't understand why.

We've looked at the execution plan and it it is different.

Is there any know issue with 2012 having issues with cursors?

Many thanks

P

April 20th, 2015 12:24pm

Please post the results of SELECT @@VERSION from both servers.

Free Windows Admin Tool Kit Click here and download it now
April 20th, 2015 12:36pm

>We've looked at the execution plan and it it is different.

>Is there any know issue with 2012 having issues with cursors?

Nothing specific to cursors.  More likely a post-upgrade query plan regression.  Ensure that your statistics are up-to-date and optimize the query.

If you post the table DDL, including indexes, the query and the two plans, someone here may be able to help.

David

April 20th, 2015 12:54pm

Can you also post the declaration of the cursor in the SP? Make sure to use options defined in this article

http://bradsruminations.blogspot.com/2010/05/truth-about-cursors-part-1.html

It could be that the defaults are different in your servers.

Also, make sure that the compatibility level of your database matches the SQL Server version.

Free Windows Admin Tool Kit Click here and download it now
April 20th, 2015 6:01pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics