<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Alphanumeric Sequence &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/alphanumeric-sequence/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Fri, 29 Sep 2017 07:16:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>SQL Server 2012: Create Sequence object to generate Alphanumeric Sequence Number</title>
		<link>https://www.dbrnd.com/2016/02/sql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number/</link>
					<comments>https://www.dbrnd.com/2016/02/sql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 03 Feb 2016 19:12:30 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Alphanumeric Sequence]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Sequence object]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1445</guid>

					<description><![CDATA[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 below data-types: tinyint smallint int bigint decimal numeric But in some situations, we also require alphanumeric Sequence Number, and for that, we should [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fsql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number%2F&amp;linkname=SQL%20Server%202012%3A%20Create%20Sequence%20object%20to%20generate%20Alphanumeric%20Sequence%20Number" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fsql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number%2F&amp;linkname=SQL%20Server%202012%3A%20Create%20Sequence%20object%20to%20generate%20Alphanumeric%20Sequence%20Number" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fsql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number%2F&amp;linkname=SQL%20Server%202012%3A%20Create%20Sequence%20object%20to%20generate%20Alphanumeric%20Sequence%20Number" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fsql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number%2F&amp;linkname=SQL%20Server%202012%3A%20Create%20Sequence%20object%20to%20generate%20Alphanumeric%20Sequence%20Number" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fsql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number%2F&amp;linkname=SQL%20Server%202012%3A%20Create%20Sequence%20object%20to%20generate%20Alphanumeric%20Sequence%20Number" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fsql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number%2F&amp;linkname=SQL%20Server%202012%3A%20Create%20Sequence%20object%20to%20generate%20Alphanumeric%20Sequence%20Number" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fsql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number%2F&#038;title=SQL%20Server%202012%3A%20Create%20Sequence%20object%20to%20generate%20Alphanumeric%20Sequence%20Number" data-a2a-url="https://www.dbrnd.com/2016/02/sql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number/" data-a2a-title="SQL Server 2012: Create Sequence object to generate Alphanumeric Sequence Number"></a></p><p>SQL Server 2012 introduced a Sequence object with lots of functionality, but unfortunately, we can only create Sequence Object with Number data-types.</p>
<p><strong>We can create a Sequence object for a list of below data-types:</strong></p>
<blockquote><p>tinyint<br />
	smallint<br />
	int<br />
	bigint<br />
	decimal<br />
	numeric</p></blockquote>
<p><strong>But in some situations, we also require alphanumeric Sequence Number, and for that, we should apply special FORMAT on the value of Sequence Number.</strong></p>
<p>Below is a full demonstration to FORMAT a Sequence value and make it alphanumeric.</p>
<p><strong>First, Create sample table:</strong></p><pre class="crayon-plain-tag">CREATE TABLE dbo.tbl_TestVarcharSequence
(
	VarcharID VARCHAR(10)
	,Name VARCHAR(255)
	,CONSTRAINT pk_tbl_TestVarcharSequence_VarcharID PRIMARY KEY(VarcharID)
)
GO</pre><p>
<p><strong>Create a Sequence object:</strong></p><pre class="crayon-plain-tag">CREATE SEQUENCE dbo.seq_TestVarcharSequenceNumber AS 
INT START WITH 1
INCREMENT BY 1;
GO</pre><p>
<p><strong>Create Sequence constraint using FORMAT function:</strong></p><pre class="crayon-plain-tag">ALTER TABLE dbo.tbl_TestVarcharSequence
ADD CONSTRAINT seq_tbl_TestVarcharSequence_VarcharID DEFAULT 
FORMAT((NEXT VALUE FOR dbo.seq_TestVarcharSequenceNumber),'ABC000000#') 
FOR VarcharID;
GO</pre><p>
<p><strong>Insert few sample records:</strong></p>
<pre class="crayon-plain-tag">INSERT INTO dbo.tbl_TestVarcharSequence (Name) 
VALUES ('Anvesh'),('Alex'),('Roy'),('Bony')
GO</pre> </p>
<p><strong>The Result:</strong></p><pre class="crayon-plain-tag">SELECT * FROM dbo.tbl_TestVarcharSequence</pre><p>
<a href="https://www.dbrnd.com/wp-content/uploads/2016/02/SQLServerVarcharSequence.png" rel="attachment wp-att-1449"><img decoding="async" class="alignnone wp-image-1449 size-full" title="SQL Server Alphanumeric Sequence" src="https://www.dbrnd.com/wp-content/uploads/2016/02/SQLServerVarcharSequence.png" alt="SQL Server Alphanumeric Sequence" width="146" height="107" /></a></p>
<p>You can find Alphanumeric Sequence Number in the above result. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/02/sql-server-2012-create-sequence-object-to-generate-alphanumeric-sequence-number/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
