Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: What is the best way to implement the autoincrementation of primary key in HANA table?

$
0
0

Quick note on IDENTITY column in SAP HANA

 

Hello all,

 

Thanks for your discussing, I found a recent article about this topic on SPS08.

It seems that column table now can be supported with identity.

syntax like this:

 

create column table test_identity (ID int primary key generated by default as identity, name varchar(10));

 

Then we can try:

insert into test_identity(name) values('kevin');

insert into test_identity(name) values('angel');

insert into test_identity(name) values('kelvin');

insert into test_identity(name) values('angela');

 

Test the results:

 

select * from test_identity

 

ID;NAME

1;kevin

2;angel

3;kelvin

4;angela

 

To see how it works closer, please refer to the quick note above.


Viewing all articles
Browse latest Browse all 9165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>