Miscellaneous Data Types in SQL Server

In sql, we have a different datatypes which will not come under string datatypes, binary data types, date and time and numeric datatypes those will be called as miscellaneous or other data types.

 

In sql, we have a different type of miscellaneous data types available, those are

 

  • cursor datatype
  • xml datatype
  • table datatype
  • uniqueidentifier datatype
  • sql_variant datatype

SQL Cursor DataType 

In sql, we can use cursor datatype to hold a reference of cursor objects. Any variables created with cursor datatype are nullable and cursor datatype cannot be used for a column while creating table.

Xml DataType in SQL Server

In sql, we will use xml datatype to store xml formatted data in column. In xml datatype column, we can store maximum of 2 GB data.

Table DataType in SQL Server

In sql, table datatype will be useful to store a table result set in variable for processing later time. The table variables can be used in stored procedures, functions and these variable cleaned up automatically at the end of function or stored procedures.

Uniqueidentifier DataType in SQL Server

In sql, the uniqueidentifier datatypes are used to store globally unique identifier (GUID).

sql_variant DataType in SQL Server

In sql, sql_variant datatype is used to store a various sql supported data types like int, char, binary, etc.

 

Following table shows a more details about miscellaneous data types in sql server.

 

Data TypeDescription
cursor It is used to store reference to cursor object
xml It is used to store xml formatted data and we can store maximum 2GB data
table It is used to store table result set for processing at a later time
uniqueidentifier It is used to store globally unique identifier (GUID)
sql_variant It is used to store values of various sql supported data types except text,ntext, varchar(max), xml, etc… We can store maximum of 8000 bytes

Topics Covered