There are several ways to run queries from a SQL file. One of the easiest ways is run scripts directly using the CSQL command line interpreter. Assuming the script you want to run is named "insert_commands.sql", the following commands should be ran within csql:
;CL ;READ insert_commands.sql ;RU
The first command, clears the command line buffer (;CLear). The second reads the sql script into the command line buffer (;REAd). The last command executes the commands in the command line buffer (;RUn).
Note: If you want the script to run quicker, then you should set autocommit to off. To do this, before running the ;RU command, you should run:
This command disables autocommit. Due to this reason, after you run the sql script, in order to commit your changes made, you MUST run:
;commit (or ;co) commits all changes made.
If you still encounter problems and you are not able to run a SQL script or import a SQL file, please contact us by posting a message in our Q&A site.