Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Find out the new features and enhancements added into SQL Server 2012, codenamed "Denali"

Moderators

Top Categories · View All
TSQL Enhancements 28
Discontinued Features 16
SSIS Enhancements 10
SSMS Enhancements 10
Database Engine 10
Database Administration 8
Security 3
Full Text Search 2
DataTime 1
Breaking Changes 1

Browse by Tags · View All
Denali 82
SQL Server 2012 79
SSIS 9
SSMS Enhancements 9
Analytic Functions 8
Usability Enhancements 5
SQL11 4
TSQL 4
Security 3
Database Engine 3
Datetime 3
Query Hints 2
OVER Clause 2
DMV 2
Groups 2
Dynamic Management Functions 2
DMF 2
System stored procedures 2
DBA 2
FTS 2

Browse by Release · View All
All 58
RC0 20
SQL Server 2012 Denali 2
CTP3 2
SQL Server Denali 1

What is new in SQL Server 2012 - Denali

Support for SEQUENCE type to generate sequential numbers

Nov 28 2011 10:27AM by Ramireddy   

The new SEQUENCE type in SQL Server 2012 will allows you to create sequential numbers. In general identity columns can be used to uniquely identify records in a table. But if we wants to maintain identity columns across multiple tables, or if we need the identity column before insertion of record into table, we can use SEQUENCE type in SQL Server 2012.

CREATE SEQUENCE CustomSequence AS INT 
START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 10000;
GO

CREATE TABLE TEST1
(
    Id int,
    Col1 varchar(100)
)
GO
CREATE TABLE TEST2
(
    ID int,
    Col2 varchar(100)
)
GO

INSERT INTO TEST1 (Id,Col1)
VALUES (NEXT VALUE FOR CustomSequence,'a')
INSERT INTO TEST2 (Id,Col1)
VALUES (NEXT VALUE FOR CustomSequence,'b')

SELECT * From Test1 
SELECT * From Test2

Output:

Id          Col1
----------- -------------
1           a


ID          Col2
----------- -------------
2           b

Read More Have you written a blog post or article related to this feature and want to get them added here? Read More...
Category : TSQL Enhancements
Release : All
Tags : SEQUENCE,Denali, SQL Server 2012, SQL11


Ramireddy
2 · 41% · 12972
4



Submit

Your Comment


Sign Up or Login to post a comment.

"Support for SEQUENCE type to generate sequential numbers" rated 5 out of 5 by 4 readers
Support for SEQUENCE type to generate sequential numbers , 5.0 out of 5 based on 4 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]