Denaaali is out..

Microsoft has released SQL Server 2012 RC 0 (RC – Release Candidate).  The product will come in 3 main editions: Standard, Business Intelligence and Enterprise.

New TSQL Features in SQL Server 2012

For the moment i can mention following features in SQL Server 2012 (Denali),

Sequence

Most of time we used to create auto generated sequence numbers in our tables most of time for primary key fields. In other cases we had to store the generated sequence numbers in a table and then had to increase one by one and as well as we had to store the number generated at last. With this edition we can use our own sequence numbers as below:

CREATE SEQUENCE DemoSequence
START WITH 1
INCREMENT BY 3;

the NEXT VALUE FOR key word is used to get the next sequence number from a sequence.

Paged Data

Most of time we use the paging functionality within a DataGrid when there are lots of records in our database. In this scenario we use the paging functionality in DataGrids.  Now we can use the paging functinality from the database end as below in SQL Server 2012.

SELECT *
FROM Employees
ORDER BY EmployeeID
OFFSET 25 ROWS
FETCH NEXT 25 ROWS ONLY;

Exception Handling

We can throw exception within a SQL Code block.

 -- EXCEPTION HANDLING using THROW in SQL Server 2012 BEGIN TRY DECLARE @VALUE INT SET @VALUE = 1/0 END TRY BEGIN CATCH THROW END CATCH 

Once you execute the above command, you will get the error as below:

Msg 8134, Level 3, State 1, Line 5 Divide by zero error encountered. 

You can download sample databases for SQL Server 2012 RC 0 from here.

SQL Server 2012 RC0 – SSMS Review

SQL Server 2012 editions

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: