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
 Database Design and Application Architecture
 add columns dynamically??

Author  Topic 

adya
Starting Member

31 Posts

Posted - 2008-09-16 : 11:38:14
i wanted to know how can we add columns to an existing tables dynamically, as the user enters information.

frontend is in asp.net 3.5 and backend is sql server 2005.

thanx in advance

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-16 : 11:47:59
its not at all a good approach. why do you want to add columns dynamically from application?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-16 : 11:48:16
This is a very bad idea and a very bad design.

Yes it is possible, but you should rethink your system if this is what you want to do. There is probably a much better way to achieve the end result.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

adya
Starting Member

31 Posts

Posted - 2008-09-16 : 13:52:34
i am storing the skills of a candidate in a table as he adds them while registering for a job.
How else can i add that information for a particular candidate.

Thanx
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-16 : 13:55:51
Show us a data example of what you mean.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

adya
Starting Member

31 Posts

Posted - 2008-09-16 : 14:04:54
i have 2 tables:

tblSkills, which stores the following information:
SkillsID(*)
SkillsName

and another table tblSkillsCandidate, which stores
CandidateID
SkillName
YearsOfExperience

I want to have a single tuple for each candidate who enters his skills, such as

CID Skill Experience Skill Experience Skill Experience
123 C++ 2 ASP 2 JAVA 1

Is it a bad idea?
or should i just have multiple rows for each candidate?

Thanx


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-16 : 14:07:59
Yes this is a bad idea as it violates one of the normal forms. Yes you should have multiple rows for each candidate.



Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

adya
Starting Member

31 Posts

Posted - 2008-09-16 : 14:16:25
thanx for the answer!

if you can let me know, which normal form was being violated?

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-16 : 14:25:19
quote:
Originally posted by adya

thanx for the answer!

if you can let me know, which normal form was being violated?





The second normal form: http://www.datamodel.org/NormalizationRules.html

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

adya
Starting Member

31 Posts

Posted - 2008-09-16 : 14:29:11
thanx!
Go to Top of Page
   

- Advertisement -