ODBC guide

Export file to another format (e.g., Excel or PDF)


Exports a Google file (e.g. Google Sheets, Docs) to another format and saves it to a local path. Supply the file ID, the target MIME type (ExportAs), and the destination path (ResponseDataFile). For shared drives, add DriveId and DriveType='drive'.

SELECT "Status" FROM export_file
WITH(
	Id='1j0HFOP4gsoE-Zbf2xN3IsPSj8wgwNtIfyyvM1_BWkW4',
	ExportAs='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
	ResponseDataFile='c:\temp\sheet1.xlsx',
	FileOverwriteMode='AlwaysOverwrite'
)