Vinay_M_R
Databricks Employee
Databricks Employee

Hi @Mrk Good day!

Please use below syntax while using GENERATED ALWAYS AS IDENTITY :

Step1: 
While creating table and defining column id as generated by always as identity mention the condition how id should be generated.

 

%sql
create table default.testidentityfinal (
id bigint generated always as identity(START WITH 1 INCREMENT BY 1),
name string
);


Step2: While inserting values into the table mention the column name under () for which you want to insert the values.
 
%sql
insert into default.testidentityfinal(name)  values("Vinay")
 
I have also attached the snapshots of the notebook of internal repro along with the output for your reference.
Please let me know if this works.