Can SQL output ASCII text files?

dslloyd2015-04-23T05:40:39Z

Structured Query Language (SQL) is a language specification to query Relational Database Management Systems (RDBMs) often just a relational database and most people think of an RDBMS when they just say database.

It's just a way to query a database.

Thus, SQL describes what data you are searching for but not what the database server should do with it. For specific databases -- such as MySQL and Postgresql -- you can give them an SQL query (along with login credentials and the way to identify which database you want to query) and then have them output the results to standard out which you can then pipe to a file. Or you can instruct their clients to output the results to a file.

You can probably do the same with Oracle, DB2, MS SQL server.

So, technically the answer is no - it's not part of the standard. However, most database servers -- or technically clients -- have some way to output the result of an SQL query to a file, encoded in ASCII or any other relevant encoding.