If you placed the building down yourself you give it a name, let's say "building1" (without the quotation marks). You also give the sandbags names: sandbag1, sandbag2, etc. Then you make a trigger. In the condition you put "!alive building1". In the activation field you put "deletevehicle sandbag1; deletevehicle sandbag2;" etc.
If the building is part of the map you could try grouping it with the trigger and putting "!alive this" in the condition. I don't know if that works though.