Function for truncating a table