Skip to content

How to run SQL script from text file

Mathias Rangel Wulff edited this page Oct 5, 2015 · 6 revisions

How to run SQL script from text file?

Question

I have all my SQL statements in text file. How to run it in AlaSQL?

Answer

You can use SOURCE statement:

    alasql('SOURCE "myfile.sql"');

Please not that accessing files in a browser should be done async to give the best user experience:

    alasql('SOURCE "myfile.sql"',[],function(res,err){...});
Clone this wiki locally