G Guest Feb 25, 2005 #1 how do you create an auto number field in Access using DDL? the Auto things it an Auto..!
C Chris2 Feb 25, 2005 #2 KhalilS said: how do you create an auto number field in Access using DDL? the Auto things it an Auto..! Click to expand... Example: CREATE TABLE Policies (policy_id AUTOINCREMENT ,policy_start_date DATETIME ,policy_renewal_date DATETIME ,premium_payable CURRENCY ,other_policy_details TEXT(255) ,CONSTRAINT pk_Policies PRIMARY KEY (policy_id) ) Sincerely, Chris O.
KhalilS said: how do you create an auto number field in Access using DDL? the Auto things it an Auto..! Click to expand... Example: CREATE TABLE Policies (policy_id AUTOINCREMENT ,policy_start_date DATETIME ,policy_renewal_date DATETIME ,premium_payable CURRENCY ,other_policy_details TEXT(255) ,CONSTRAINT pk_Policies PRIMARY KEY (policy_id) ) Sincerely, Chris O.
J Jamie Collins Feb 28, 2005 #3 Chris2 said: CREATE TABLE Policies (policy_id AUTOINCREMENT ,policy_start_date DATETIME ,policy_renewal_date DATETIME ,premium_payable CURRENCY ,other_policy_details TEXT(255) ,CONSTRAINT pk_Policies PRIMARY KEY (policy_id) ) Click to expand... FWIW I prefer the synonym IDENTITY i.e. the same for SQL Server. Also, you can explicitly specify the data type plus the seed and increment values e.g. could make your column definition clearer with: policy_id INTEGER IDENTITY (1,1) NOT NULL Jamie. --
Chris2 said: CREATE TABLE Policies (policy_id AUTOINCREMENT ,policy_start_date DATETIME ,policy_renewal_date DATETIME ,premium_payable CURRENCY ,other_policy_details TEXT(255) ,CONSTRAINT pk_Policies PRIMARY KEY (policy_id) ) Click to expand... FWIW I prefer the synonym IDENTITY i.e. the same for SQL Server. Also, you can explicitly specify the data type plus the seed and increment values e.g. could make your column definition clearer with: policy_id INTEGER IDENTITY (1,1) NOT NULL Jamie. --