Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

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

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
venmarces
Asked:
venmarces
2 Solutions
 
LowfatspreadCommented:
no you can only have 1 identity column per table

why do you think you need a second?
0
 
Brendt HessSenior DBACommented:
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
 
venmarcesAuthor Commented:
good
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now