Data flow task fails because TempDB is full

0

My OLE DB Source query goes something like this:

select a,b,sum(c)
from(select a,b,c from t1 union all 
     select a,b,c from t2 union all 
     select a,b,c from t3) a
inner join t2 on ...
group by a,b

It gives me the following error:

SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E14 Description: "Warning: Null value is eliminated by an aggregate or other SET operation.". An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E14 Description: "Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in filegroup 'DEFAULT'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.".

The source tables aren't that big, they have around 3M rows between them. Any idea how I can deal with tempdb errors ?

sql
sql-server
database
ssis
asked on Stack Overflow Aug 13, 2020 by Random it guy • edited Aug 13, 2020 by Eric Brandt

1 Answer

0

Preaggregating the tables might help:

select a, b, sum(c)
from ((select a, b, sum(c) as c
       from t1
       group by a, b
      ) union all 
      (select a, b, sum(c) as c
       from t2
       group by a, b
      ) union all 
      (select a, b, sum(c)
       from t3
       group by a, b
      )
     ) t inner join
     t2
     on ...
group by a, b;
answered on Stack Overflow Aug 13, 2020 by Gordon Linoff

User contributions licensed under CC BY-SA 3.0