user1047517
user1047517

Reputation: 1559

MySQL Server Stored Procedure AUTO_INCREMENT UNIQUE

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

Answers (1)

Gadonski
Gadonski

Reputation: 3330

set the field Number as NOT NULL AUTO_INCREMENTand in the insert sql INSERT INTO Account(Customer, Credit) VALUES(pCustomer,0);

Upvotes: 2

Related Questions