How to Auto-Increment Non-Primary Key? - SQL Server

Posted by user311509 on Stack Overflow See other posts from Stack Overflow or by user311509
Published on 2010-04-08T15:28:24Z Indexed on 2010/04/08 15:33 UTC
Read the original article Hit count: 197

Filed under:
|
|
|
|
CREATE TABLE SupplierQuote
(
supplierQuoteID int identity (3504,2) CONSTRAINT supquoteid_pk PRIMARY KEY,
PONumber int identity (9553,20) NOT NULL
.
.
.
CONSTRAINT ponumber_uq UNIQUE(PONumber)
);

The above ddl produces an error:

Msg 2744, Level 16, State 2, Line 1 Multiple identity columns specified for table 'SupplierQuote'. Only one identity column per table is allowed.

How can i solve it? I want PONumber to be auto-incremented.

© Stack Overflow or respective owner

Related posts about sql

Related posts about database