difference in using loop and using cursor in sql

most interviewer ask this question

Your Answer

Hope this may helps you 
Loop is used to repeatdely call a block of code in sql
But cursor is used to iterate through the rows of the specified record set  which means it repeatdely call a block of code + iterate through a row of specific record.
For Better understanding C# Example
We use for,while loop in c#  which works same as loop in sql and
we use foreach which work same as cursor in sql 
 

Sql Server

Didn't get the answer.
Contact people of Talent-Sql Server directly by clicking here