0

When I make a Insert Into statement it exists any way to predicte how much space that statement it will fill in TempDB?

Thanks

Pedro Alves
  • 1,004
  • 1
  • 21
  • 47
  • 1
    The only way to "predict" it would be to run a query to see how much data is in the rows. What are you really trying to accomplish here? – Sean Lange May 17 '17 at 13:29
  • I'm having troubles about size in TempDB and I want to verify each time that I run the statement if it's gonna return error because the size of TempDB or not – Pedro Alves May 17 '17 at 13:31
  • 1
    sounds like your problem isn't likely a single query but a tempdb size (disk allocation) problem. – S3S May 17 '17 at 13:43
  • Yes, I already ask for add more disk. But I am trying to add more best practices in my processes. And I think that Know if the query statement will be very heavy to the TempDB... there exists any way? – Pedro Alves May 17 '17 at 13:46
  • 1
    NumberOfRows * SpaceReservedForEachRow = PredictedSpaceTheStatementWillConsume You may want to start at this link https://technet.microsoft.com/en-us/library/ms176029(v=sql.105).aspx – Jacob H May 17 '17 at 13:57
  • You seem to be lacking any real details about what you are trying to do here. – Sean Lange May 17 '17 at 14:01
  • Thanks @Jacob H :) – Pedro Alves May 17 '17 at 14:14

1 Answers1

1

This question can be answered in different ways. I generally use different drives for Data, Log, and TempDB. As a rule of thumb, I use 1/3 to 1/2 of the size of the data disk for both, the log disk and the TempDB disk.

Example: Disk C:\ for OS 50 GB Disk D:\ for SQL-Server 50 GB Disk J:\ for Data 100 GB Disk L:\ for Log 40 GB Disk T:\ for TempDB 40 GB

For a development server I occasionally use only a C:\ and a D:\ drive. In that case, if I have the same space requirements as above, Disk C:\ would still be 50 GB, but Disk D:\ is now the combine amount of 230 GB

ChristianA
  • 11
  • 2