See Also
You are here: SQL Reference > SQL Functions and Operators > Scope Functions > AUTOIDENTITY
ContentsIndexHome
PreviousUpNext
AUTOIDENTITY
AUTOIDENTITY

 

Syntax

AUTOIDENTITY()

 

Returns next identity value. Function only called by INSERT statement to insert the new identity value for column(s) that declared the function as default value in CREATE TABLE command. 

 

Example  

CREATE TABLE test_ident
(
id bigint not null default( AutoIdentity()),
name varchar(100)
);

go;

insert into test_ident(name) values('test1');
insert into test_ident(name) values('test2');
insert into test_ident(name) values('test2');

select * from test_ident;

 

Related