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.
| Author |
Topic |
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-01-04 : 07:00:06
|
| Hiactally, i have a table, having foriegn key and primary key also.how can i drop these keys and add unique key to that column?thank you very muchVinod |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-01-04 : 07:03:47
|
1. To drop constraintAlter Table table-nameDrop Constraint constraint-name 2. To add constraintAlter Table table-nameAdd Constraint constraint-name... Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-01-04 : 07:29:21
|
| Suppose I have column001, column002 and column003 in my table,i need this constraint on all the three columns. is it possible?Vinod |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-01-04 : 07:32:25
|
Yes.alter table Table1add constraint uniq1 unique (column001, column002, column003) Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-01-04 : 07:33:56
|
| Thank you Mr.Harsh for your great help.thank you very much.Vinod |
 |
|
|
|
|
|