From the SQL tab, select . Save the file to a location. The SQL statement is exported as a .txt file.