Table column count competition
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
Darn, highest I could find was 84, using this query:
SELECT
t.Name AS [Table Name],
COUNT(*) AS [Column Count]
FROM sys.Tables AS t
JOIN sys.Columns AS C
ON t.Object_ID = c.Object_ID
GROUP BY
t.Name
ORDER BY
COUNT(*) DESCCredit to Pinal Dave for most of the code.
-
GuyThiebaut wrote:
required for each row
GuyThiebaut wrote:
medical database
I'm not convinced -- if the table had columns for right and left arm etc., what did you do for patients with missing arms? Leave NULLs? I'd prefer to have different tables for different body parts. :-D
and how would you represent a person that is a dick head?
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1 -
and how would you represent a person that is a dick head?
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1I'd add a record to the [Brendan Fraser] table.
-
and how would you represent a person that is a dick head?
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1:laugh: :laugh: :laugh: +5
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
-
I'd add a record to the [Brendan Fraser] table.
-
and how would you represent a person that is a dick head?
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1Referential integrity would prevent that.
-
Referential integrity would prevent that.
So would birth control!
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1 -
Darn, highest I could find was 84, using this query:
SELECT
t.Name AS [Table Name],
COUNT(*) AS [Column Count]
FROM sys.Tables AS t
JOIN sys.Columns AS C
ON t.Object_ID = c.Object_ID
GROUP BY
t.Name
ORDER BY
COUNT(*) DESCCredit to Pinal Dave for most of the code.
-
So would birth control!
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1Too late for that.
-
Too late for that.
I'd recommend a lobotomy, but I'm afraid Mr. Fraiser has already had his!
VS2010/Atmel Studio 6.0 ToDo Manager Extension
Version 3.0 now available. There is no place like 127.0.0.1 -
Too late for that.
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
Move it to the fourth normal and get rid of the nulls.
Need custom software developed? I do custom programming based primarily on MS tools with an emphasis on C# development and consulting. I also do Android Programming as I find it a refreshing break from the MS. "And they, since they Were not the one dead, turned to their affairs" -- Robert Frost
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
We have a table with 289 columns. It's in our insurance reserves calculating database, and I have no idea what the table actually does, and I don't think I want to know (there are 7 tables with more than 140 columns)
-
GuyThiebaut wrote:
required for each row
GuyThiebaut wrote:
medical database
I'm not convinced -- if the table had columns for right and left arm etc., what did you do for patients with missing arms? Leave NULLs? I'd prefer to have different tables for different body parts. :-D
Yes there are better ways of representing the data - it all depends on what you are going to do with it. If you are just looking at a simple full table scan then a wide row can be the best approach. The difficulty is that when you design your tables inevitably six months later there will be a better way to store the data based on how you now want to query it. In the end you just do the best you can with the information you have at the time and rely on the database engine to do the optimisation for you later - if things get really slow you can always de-normalise your data...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
Vasily Tserekh wrote:
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad:
ps. the table is already in 3rd normal form155 attributes, all depending on the same key? And none that depend on a part of the key? No repeating groups? All atomic values? Show me :)
Bastard Programmer from Hell :suss:
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
I needed to supply some data to a stress test system using SQL 2005, ran out of columns when I hit 1200, I was hoping to create a temp table with 3.6k columns because I could then use my nifty table to CSV utility. Devised a different strategy. I have seen many systems with over 200 columns in a table, usually legacy apps that migrated from power users to core system somehow.
Never underestimate the power of human stupidity RAH
-
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad: ps. the table is already in 3rd normal form
We have plenty of 3rd normal tables with more than 1024 columns (they are split across multiple tables). Market research surveys have a large number of data points sometimes.
-
Vasily Tserekh wrote:
I have a table in the application i am developing of 155 columns i dare anyone to beat me:mad:
ps. the table is already in 3rd normal form155 attributes, all depending on the same key? And none that depend on a part of the key? No repeating groups? All atomic values? Show me :)
Bastard Programmer from Hell :suss:
its an inspection form and every value its a part of the inspection list
-
its an inspection form and every value its a part of the inspection list
That's not an argument. I can show you a lot forms crammed with unrelated data - I want to see 155 attributes in 3NF, and them being in the same form doesn't necessarily mean that they should be in the same table. Simply listing their names will do :)
Bastard Programmer from Hell :suss: