Max number of columns in a table if using just the float data type

Hi  - because I really dont want to get this wrong - how many float columns can a SQL Server 2000 table hold. I know that the max row size is 8060 bytes.
Paul_BlacklerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
dbaSQLConnect With a Mentor Commented:
agreed w/ac on that -- it's an awful lot of columns.  but, in the event that you have that many, or even fewer, as float, you are still restricted to the 1024 columns per table.  SQL isn't going to restrict you further if they're all float.  it will create the table, you will just be told that if you define the table with a row length greater than 8060, your inserts aren't going to work.
0
 
dbaSQLCommented:
the max number of columns sql v2000 table can have is 1024 -- providing they don't exceed the 8k per row, as you've stated.

i do not know if there is any reason why 1 or all of these could not be float
0
 
Paul_BlacklerAuthor Commented:
But if a float is used and filled to the maximum, there will be a finite number of columns that could be used surely as we have 8060 bytes - its that number that I am looking for?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Anthony PerkinsConnect With a Mentor Commented:
A float takes up 8 bytes so you could potentially have more than 1000 columns.

Personally unless I was working on an Astronomy project I would never use float.  But whatever works for you.
0
 
Anthony PerkinsCommented:
And I should have added, IMHO any table that has half as many columns as that is highly suspect.
0
 
Anthony PerkinsCommented:
By the way when I stated you could have more than 1000 columns, I was making the assumption that you did not allow Nulls.  If you do than the total number of columns is significantly less.
0
 
Paul_BlacklerAuthor Commented:
acperkins - you stated if you did not allow nulls it would be far less - but surely if you did allow nulls it would still be 1000 would it not? :)
0
 
Anthony PerkinsCommented:
>>but surely if you did allow nulls it would still be 1000 would it not? :)<<
Nope.  Enabling Nulls requires overhead.  Hence less than 1000 columns.

0
All Courses

From novice to tech pro — start learning today.