Binary Data
Binary data is stored in a set of four data types.
Binary Data Types
DATA TYPE
RANGE OF VALUES STORAGE SPACE
BIT
Null, 0,
and 1
1
bit
BINARY
Fixed-length
binary data
Up to 8,000 bytes
VARBINARY
Variable-length binary
Up to
8,000 bytes
XML Data Type
What is XML?
XML stands for Extensible Markup
Language like HTML was designed to carry data, not to
display data.
XML Data Type
XML data type allows you to store and manipulate
Extensible Markup Language (XML) documents natively. When storing XML
documents, you are limited to a maximum of 2 GB, as well as a maximum of
128 levels within a document. Although you could store an
XML document in a character column, the XML data type natively
understands the structure of XML data and the meaning of XML tags within
the document.
Because the XML data type
natively understands an XML structure, you can apply additional
validation to the XML column, which restricts the documents that can be
stored
based on one or more XML
schemas.
XML schemas are stored within
SQL Server in a structure called a schema collection. Schema collections
can contain one or more XML schemas. When a schema collection is applied
to an XML column, the only documents allowed to be stored within the XML
column must fi rst validate to the associated XML schema collection.
Spatial Data Types
SQL Server 2008 supports two data types to store spatial data.
Geometry
Geography
Geography
Geometric Data
Geometric data is based on Euclidean geometry and is
used to store points, lines, curves, and polygons.
Geographic Data
Geographic data is based on an
ellipsoid and is used to store data such as latitudes and longitudes.
SPECIAL COLUMNS.
You define spatial columns in a table
using either the GEOMETRY or GEOGRAPHY data
types. When values are stored in a
spatial column, you have to create an instance using one
of several spatial functions specific
to the type of data being stored. A GEOMETRY column
can contain one of seven different
geometric objects with each coordinate in the definition
separated by a space.
Geometry Data Type Definitions
Multi Polygon
Contains the coordinates for
multiple Polygons.
Has x and y coordinates, with optional elevation and measure values.
Line String
A series of points that defines the start, end, and any bends in the line, with optional elevation and measure values.
Polygon
A surface defined as a sequence of points that defines an exterior boundary, along with zero or more interior rings. A polygon has at least three distinct points.
Geometry Collection
Contains one or more instances of other geometry shapes, such as a Point and a Line String.
MultiPoint
Contains the coordinates of multiple Line Strings.
Contains the coordinates of multiple Line Strings.
HIERARCHY ID Data Type
The HIERARCHY ID data
type is used to organize hierarchical data, such as organization charts, bills
of materials, and flowcharts. The HIERARCHY ID stores a position
within a tree hierarchy. By employing a HIERARCHYID, you can quickly
locate nodes within a hierarchy as well as move data between nodes within the
structure.
Example
REFRENCES
http://msdn.microsoft.com/en-us//library/ms188362.aspx
http://technet.microsoft.com/en-us/library/ms179366(v=sql.105).aspx