You can easily run Transact-SQL (T-SQL) script files (with extension .sql) via the commandline utility sqlcmd:
sqlcmd -S Server\Instance -i C:\path\to\SomeScript.sql
By default, the output is written to the command prompt. You can also save the output to a file:
sqlcmd -S Server\Instance -i C:\path\to\SomeScript.sql -o C:\path\to\TheOutput.txt
Note that when using this, no output is written in the command prompt window.
An excellent resources website on how to configure Cisco phones to work on Asterisk. This includes the provisioning of phones, configuring them in Asterisk and enabling advanced functionality for Cisco on Asterisk.