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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Alter Table To Set Unique Field - SqlServer 2008
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

paramu
Posting Yak Master

151 Posts

Posted - 06/20/2011 :  01:53:06  Show Profile  Reply with Quote
Hi,
I have table MyAddress like the below..

Door_no nvarchar(25)
Street nvarchar(50)
Road nvarchar(50)
city nvarchar(50)
state nvarchar(50)
country nvarchar(50)

Now I like to set this field Door_no to be Unique field.

For that any ideas?

Thanks for the helps

Paramu @ PARANTHAMAN

senthil_nagore
Flowing Fount of Yak Knowledge

India
1007 Posts

Posted - 06/20/2011 :  02:31:31  Show Profile  Visit senthil_nagore's Homepage  Send senthil_nagore a Yahoo! Message  Reply with Quote
Making Door_no as UNIQUE is sensible?

Different person have same door no in different street/city/state/country.

Any way the synatx is

ALTER TABLE <table_name> ADD UNIQUE (column_name)

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

paramu
Posting Yak Master

151 Posts

Posted - 06/20/2011 :  02:52:14  Show Profile  Reply with Quote
Hi Senthil Nagore,
Thanks For The Comments!


Paramu @ PARANTHAMAN
Go to Top of Page

senthil_nagore
Flowing Fount of Yak Knowledge

India
1007 Posts

Posted - 06/20/2011 :  02:58:39  Show Profile  Visit senthil_nagore's Homepage  Send senthil_nagore a Yahoo! Message  Reply with Quote
quote:
Originally posted by paramu

Hi Senthil Nagore,
Thanks For The Comments!


Paramu @ PARANTHAMAN



Welcome

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000