Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to drop UNIQUE CONSTRAINT on only one column

Author  Topic 

venkatasql
Starting Member

1 Post

Posted - 2014-05-05 : 02:15:42
Hi All,
I am very new to sql and I have got this doubt.

CREATE TABLE employee
{ EMP-ID VARCHAR UNIQUE,
DESIG VARCHAR UNIQUE,
SALARY INT };


Probably this is worst table ever created :).Now How to drop UNIQUE constraint on only column lets DESIG.

if i write

ALTER TABLE employee
DROP CONSTRAINT myuniqueconstraint;


will drop constraints on both columns which I dont want.
Please suggest a query that remove UNIQUE CONSTRAINT only on DESIGN column.


and one more clarification,

ALTER TABLE employee
MODIFY SALARY INT NOT NULL;

ALTER TABLE employee
ALTER COLUMN SALARY INT NOT NULL;


which of the above two is right query to add NOT NULL constraint to the above employee TABLE?

Please help folks!

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-05-05 : 09:24:57
The syntax and your observations suggest that you are using an RDBMS other than Microsoft SQL Server. This forum is for Microsoft SQL Server, so there are not many experts on other RDBMS that frequent this forum. You might get better responses at a forum specific to your RDBMS.
Go to Top of Page
   

- Advertisement -