Reputation: 1559
I am writing a stored procedure in MySQL Community Server 5.5.16 and I need insert there ID which should auto increment and be unique. I am not sure how to do it. Should I use something like this:
Declare Z AUTO_INCREMENT UNIQUE;
Upvotes: 0
Views: 1540
Reputation: 3330
set the field Number
as NOT NULL AUTO_INCREMENT
and in the insert sql INSERT INTO Account(Customer, Credit) VALUES(pCustomer,0);
Upvotes: 2