SQL SERVER – Is Cursor Database Object or Datatype?

Whenever we want to loop something we always look for logic like WHILE LOOP or FOR LOOP. Trust me on my word that both of them are cursor when it is about SQL Server.

SQL SERVER - Is Cursor Database Object or Datatype? loop It is commonly believed that the cursor is Database Objects. I have always given the definition of it as they are database objects used to manipulate data in a set on a row-by-row basis.

Just a few days ago – Imran one of the active readers of the blog asked me question if the cursor is database object or datatype? My answer to this question is it is Database Object. However, this question is very, very interesting. We define cursor same was as datatypes using DECLARE statement and it can be used the same way as any other data types.

I would like to see all of your opinions about what do you think about the this subject? Database Object or Database Datatype.

Here are few of the blog posts which are very much related to the subject. I would like all of you to check that out..

Simple Example – Part 1

Simple Example – Part 2

Please leave a comment with your thought. I will be happy to discuss with you more on this topic.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Cursor, SQL Server
Previous Post
SQL SERVER – 2005 – Restore Database Using Corrupt Datafiles (.mdf and .ldf)
Next Post
SQL Authority News – SQL Server Interview Questions – SQL Related Jobs – DBA Job Description

Related Posts

34 Comments. Leave new

Leave a Reply