MySQL Notes

The following in MySQL:

describe <table_name>;

is the same as MSSQL’s:

select * from information_schema.columns where table_name='<table_name>';

How do you drop an unnamed constraint (in this case a primary key) from a table in MS SQL? After two hours of searching? The answer:

First, find the constraint name using

select * from information_schema.CONSTRAINT_COLUMN_USAGE;

Then, simply:

alter table table_name drop constraint constraint_name;

THEN, to add a new primary key

alter table table_name add new_column int identity(1,1) primary key not null;

Leave a Reply