Microsoft® SQL Server® 2012 Bible

(Ben Green) #1

76


Part I: Laying the Foundations


partner’s identity can also be supplied as an optional parameter in the database connection
string using the Failover_Partner keyword.

Additionally, you can also use SNAC to take advantage of the new AlwaysOn Availability
Groups feature built on the mirroring technology. Applications using SNAC can connect to
the primary replica of a given availability group either via a network name or connection
strings much like you do with mirroring.

Applications connecting to an availability group using SQL Server Native Client can
connect using an availability group listener, which is a virtual network name for
the availability group. This concept should be familiar if you’ve ever set up a cluster
and had to configure a virtual name for the cluster. For more information on set-
ting up and interacting with AlwaysOn Availability Groups see Chapter 27, “Database
Mirroring.”

If the connection to the principal server fails for a transaction, and if a transaction is involved, it will be rolled
back. The connection must be closed and reopened to access the failover partner, and then any data work must
be reapplied. The failover connection is automatic as long as the failover partner’s identity is a part of the
connection object supplied from either the connection string or a prior successful connection to the server before
it went down.

Chapter 28, “Replicating Data,” details another tool used in disaster recovery setups or copying and
distributing data and database objects across servers.

Improved Date/Time Support
SQL Server 2008 introduced the distinct date and time data types. These distinct data
types provide much more fl exibility for application developers when dealing with date and
time types.

The distinct time type offers precision accurate up to 100 nanoseconds. This preci-
sion can be accessed via new types in SNAC: DBTYPE_DBTIME2 for OLE DB providers
and SQL_SS_TIME2 for ODBC providers. If an application is written to use time with
no fractional seconds, you can use time(0) columns. Precision of this magnitude can be
extremely useful in process control and manufacturing applications that require that
level of precision.

Other time-related support available is the ability to use date-time values with timezone
information. This feature is supported through the use of DBTYPE_DBTIMESTAMPOFFSET
for OLE DB and SS_TIMESTAMPOFFSET for ODBC types.

c04.indd 76c04.indd 76 7/30/2012 4:12:45 PM7/30/2012 4:12:45 PM


http://www.it-ebooks.info
Free download pdf