Home Dashboard Directory Help
Search

Sql Server 2012 cursor not fetching all records for databases in Availability Groups by ChrisStewart999999999


Status: 

Closed
 as Won't Fix Help for as Won't Fix


4
0
Sign in
to vote
Type: Bug
ID: 773604
Opened: 12/5/2012 3:23:50 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

When using a basic cursor to iterate through names of databases on which to perform actions (log backups in this case) the query used to generate the cursor returns all expected rows but the cursor iteration does not.
When running the SELECT statement alone there are 5 database names returned; when iterating through the cursor only the first and last are returned. If the "STATIC" keyword is added to the cursor declaration then all 5 results are returned. If the LEFT OUTER JOIN portion of the query is removed then the query returns all expected values. This isn't a viable workaround for us since we need to execute this job on all servers participating in an Availability Group setup and need to only execute the commands against databases being hosted on the server.
Details
Sign in to post a comment.
Sign in to post a workaround.