Cursor Vs While loop in sql server
In cursors, we have to create the cursor, open it, use it, close it and deallocate the cursor. So we are facing additional overhead in case of using cursors.
Cursors are heavy weight object holds huge memory when compare to while loop.
In case of any breakage in the mid of looping the cursor we have to take care about the exception handling mechanism to de-allocate the cursor. Its an additional overhead for us.
Clustered index Vs Non Clustered index
Clustered index is too fast where as non clustered index is comparatively slower.
Clustered index will hold huge memory for creation and for working when compared to non clustered index.
Only one clustered index can be created for a table where as 249 non clustered index can be created.
No comments:
Post a Comment