Solved

Add more than one auto-incremental field in SQL Server table

Posted on 2011-09-26
3
245 Views
Last Modified: 2012-08-13
Hi

we have a table called Table1 and it has a primary key IDTable1 which is an auto-incremental field. we want to make another field as an auto-incremental field too. is it possible to do that, because it sounds like you can only make one auto-incremental at a time in SQL Server table.

How we can do this with SQL instructions by :
Alter Table bla bla bla .......

Thanks  
0
Comment
Question by:venmarces
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 50

Accepted Solution

by:
Lowfatspread earned 250 total points
ID: 36602517
no you can only have 1 identity column per table

why do you think you need a second?
0
 
LVL 32

Assisted Solution

by:bhess1
bhess1 earned 250 total points
ID: 36602607
You can mock up auto-incrementing fields using triggers, but you can not use more than one identity field (which is the auto incrementing field type) in a single table.  How you mock up another incrementing field depends on what you want to do with it.  

So, please specify what it is you wish to accomplish.
0
 

Author Closing Comment

by:venmarces
ID: 36981261
good
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question