Avatar of rc
rc
Flag for United States of America asked on

Temp table max size

Hello Experts,

I would like to get some insight about the temp tables in sql server. I am using sql server 2012. I have a temp table with 120 columns, I was wondering how many columns a temp table can handle and what is the limit of number of records that can be stored in the temp table.

Thanks in advance!!
Microsoft SQL Server 2008Microsoft SQL Server 2005

Avatar of undefined
Last Comment
John_Vidmar

8/22/2022 - Mon
SOLUTION
guswebb

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Jim Horn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
John_Vidmar

Your data-page-size limits the size of each record contained in your table configuration.  Example, if you have a 4k data-page then the sum of the fixed-length columns may not exceed that limit (of course, there is data-page overhead, so you will not get exactly 4096 bytes for data).  So, in your example, 120 columns is achievable if you don't have many big char fields.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23