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
 Sub Column

Author  Topic 

jaugwar
Starting Member

6 Posts

Posted - 2011-08-28 : 23:20:51
Can any one help with this:

How to create sub column for a column?
For Eg. If you create a columns say Phone_Number and you want to add more than one phone number for a record. so how can one do this?

Thank you.

jackson

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-29 : 00:14:44
keeping into consideration 1 NF, the best way to do this is to add an associated table which will have PhoneNumberID,ActualNumbervalue and FK which relates to your main table.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

gwilson67
Starting Member

42 Posts

Posted - 2011-08-29 : 00:36:54
More than one phone number means you need a relationship to another table.

Greg
http://www.freewebstore.org/tsqlcoderepository
Powerful tool for SQL Server development
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-29 : 00:54:35
yep. you'll have one to many relationship from your current table to new table. this will make it flexible and enable you to add as many phone numbers as possible associated to single entity to your main table.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -