Jump to content

How to alter a table to include a primary key?


APD1993

Recommended Posts

Hi,

 

I want to be able to add a primary key to a table through altering the table. At the moment, I am using coding such as:

 

USE test3;
ALTER table users ->ADD primary key (uname);

 

But I get told: No database selected

 

Does anyone know how to fix this?

 

Any help is appreciated :)

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.