Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alter Column syntax help 1

Status
Not open for further replies.

litton1

Technical User
Apr 21, 2005
584
GB
Trying to move a DB from SQLExpress to MySQL :(

I am making a simple table to get my head around the syntax
Code:
create table Product
(
  ProductID int not null,
  ProductID_Parent int default null,
  Name varchar(50)
) type=InnoDB;
but having some problems with creating the PK which needs to be separate from the Table definitions.
Any help appreciated.

Code:
ALTER TABLE Product
    Alter Column ProductID INT NOT NULL AUTO_INCREMENT Add "FK_Product" PRIMARY KEY

Age is a consequence of experience
 
thx for your reply and sry that should say
Code:
ALTER TABLE Product
    Alter Column ProductID INT NOT NULL AUTO_INCREMENT Add "PK_Product" PRIMARY KEY

Why... because that is what has been asked of me.

Age is a consequence of experience
 
ALTER TABLE Product
CHANGE COLUMN ProductID
ProductID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY


r937.com | rudy.ca
 
That did the trick. Thanks!

Age is a consequence of experience
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top