Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Declaring the cursor as read only

Author  Topic 

reacha
Starting Member

49 Posts

Posted - 2010-10-13 : 12:58:41


declare cursor_WF_AUDITLOG_MetricsInter cursor
[FORWARD_ONLY][READ_ONLY]
For select pkgid from WF_AUDITLOG_MetricsInterp
where AuditStampCompleted is null

i want to declare the cursor as read only.

Means just declaring the cursor and

opening it and fetch next from it


I need to optimize the cursor.

Please help me out!!

Thanks,
reacha

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-10-13 : 13:05:40
take out the square brackets []
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-10-17 : 02:50:06
it would be worth checking if you can apply a set based solution rather than using cursor which does row by row processing. A set based solution might perform better in most occasions

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -