SQL Server 2012: Create Sequence object to generate Alphanumeric Sequence Number

SQL Server 2012 introduced a Sequence object with lots of functionality, but unfortunately we can only create Sequence Object with Number data-types.

We can create a Sequence object for a list of this data-types:

  • tinyint
  • smallint
  • int
  • bigint
  • decimal
  • numeric

But in some situation we also require alphanumeric Sequence Number and for that we should apply special FORMAT on the value of Sequence Number.

Below is a full demonstration to FORMAT a Sequence value and make it alphanumeric.

First, Create sample table:

Create a Sequence object:

Create Sequence constraint using FORMAT function:

Insert few sample records:

The Result:

SQL Server Alphanumeric Sequence

You can find Alphanumeric Sequence Number in the above result.

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

1 Comment on "SQL Server 2012: Create Sequence object to generate Alphanumeric Sequence Number"

Notify of

Sort by:   newest | oldest | most voted
6 months 11 days ago

What’s up to every , since I am really keen of reading this weblog抯 post to be updated daily. It consists of nice material.