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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dynamic Column Adding

Author  Topic 

rbharatha
Starting Member

29 Posts

Posted - 2002-05-12 : 22:34:41
hi Sqlteam.,
I have to add dynamic column in my table.,
ex: I got Panel Board Members for Interview.

Application Id, Off1, Off3, Off3, Off4, Off5, Year

if suppose next year there would be more no off Officers, so how could i add the columns

thankx

Ramesh

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-05-13 : 00:11:20
Sounds like a really bad idea.

You should reorganise your tables so that all the "dynamic" elements are rows...

ie
Instead of
AppID, Off1, Off2, Off3, Off4, Off5, Year
34, ROB, BILL, JO, RAVI, FREDA, 1997

you might have
Table1
AppID, Group, Year
34, SQLTeam, 1997

Table2
GID, Group, Officer, Name (or whatever)
1, SQLTeam, Off1, ROB
2, SQLTeam, Off2, BILL
3, SQLTeam, Off3, JO
etc, etc

(you could normalise this further but....)

Alternatively, you could just wait for Byrmol, because he should be along soon...

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2002-05-13 : 03:50:26


i totally agree what rrb say.. when any data increase dynamic it is advice to put in rows than columns

======================================
Ask to your self before u ask someone
Go to Top of Page
   

- Advertisement -