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 2005 Forums
 Transact-SQL (2005)
 Data in Columns vs Rows

Author  Topic 

jk295
Starting Member

1 Post

Posted - 2007-05-22 : 16:14:11
Which of these is better if you don't know how many fields you may have?(ie a User may add via a web page?)
Which is better if you do know how many fields you will have?
What about Data Types in #2



#1
ID Field1 Field2 Field3 Field4
1 Test 11 1.34 1/1/2007

#2
ID FieldName Value
1 Field1 Test
1 Field2 11
1 Field3 1.34
1 Field4 1/1/2007

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-05-22 : 16:21:35
Well, you'd have the problems of datatype either way. If your user can add fields, let him/her also choose the datatype. Not sure what you are actually trying to do. So we can just make guesses on #1 or #2, without knowing what actually is happening.

Dinakar Nethi
SQL Server MVP
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -