Monday, March 7, 2011

Transact-SQL in SQL Server 2005

Transact-SQL is the version of the Structured Query Language (SQL) used by
SQL Server 2005. Transact-SQL is often abbreviated to T-SQL. T-SQL has many
features, which are not included in ANSI SQL.
 
Improved XML support
SQL Server 2000 allowed you to retrieve relational data as XML with the FOR
XML clause or store XML as relational data in SQL Server, using the OPEN XML
clause. SQL Server 2005 has a new xml datatype that allows you to write
code to retrieve XML data as XML, avoiding the transformation from XML to
relational data that occurred when using OPEN XML. You can also use a
schema document expressed in the W3C XML Schema Definition language
(sometimes called XSD schema) to specify allowed structures in the XML.
Note: Strictly speaking, the xml datatype stores data in a proprietary binary
format. For practical purposes, you can retrieve and manipulate the data
as XML.
 
Error handling
SQL Server 2005 allows you to use TRY ... CATCH blocks in your T-SQL
code. So, if your code causes an error, the code in the CATCH block allows
you to specify what to do when an error occurs.
 
Transact-SQL templates
In SQL Server Management Studio, you can find many templates to help you
carry out common tasks with Transact-SQL. To view the range of T-SQL templates,
choose View➪Template Explorer in SQL Server Management Studio.
The Template Explorer displays. View the nodes to see the range of templates
available.

No comments :

Post a Comment