Sunday 17 March 2013

Why database devloper do not like to use cursor in sql server?

   Hi,
       Sql server is  set based relational database rather than row based.Cursor work on row based computing.It took time  So it may lead performance issue in realtime.
you may have doubt on what is set base and row based.

Set Based  :
    e.g consider following query

 select * from tblTemp_Sample where sample_id in( '1','2','3','4' )
or
 select * from tblTemp_Sample where sample_id in(  select sample_id from sample1 )
 now above query will  compair result on set basis .


Row Based :
 If we will do programming with cursor then it will do row by row comparison.

No comments:

Post a Comment

First Database In Sql Server