I am creating a table, how can I set primary key for my table without using my mouse ? I wanna do this with my keyboard (short key).
To find this out, press CTRL+L to display the estimated query execution plan as shown below without actually running the whole query (in fact it runs for top 1 row).
Try with: Alt+L,Y (case insensitive).
That keyboard shortcut will mark as PrimaryKey
of selected column (on design mode).
Here is an example:
CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
PRIMARY KEY (P_Id)
)
P_Id is the column with the primary key constraint.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With