I spoke to the plugin maintainer David Fishburn - I was amazed at the time-out he took to help a novice like me: great guy.
Initially he suggested
I believe the cmd terminator for SQLSRV is "\ngo\n" not ";".
If you want to change it temporarily to try in this buffer run: :DBSetOption cmd_terminator=';'
Try the cmd again.
If that works you can either override the default or change your profile to override it.
Then in answer to some further related questions:
Q1. What is "\ngo\n" ?
Because the string is enclosed in double quotes, Vim treats escaped characters differently. \n - newline go \n - newline
So for SQL Server this would be typical:
CREATE PROCEDURE BEGIN END go
Which is actually:
"END\ngo\n"In other words, "go" has to be on a newline, with only "go" on the line.
Q2. Do I just add the following to _vimrc for it to become permanent?:
DBSetOption cmd_terminator=';'
No. :DBSetOption is used to modify current buffer settings only, not permanent settings.
The best thing you can do is read through :h dbext.txt.
The specific answer to your question lies in :h dbext-configure-options
5.3 Database Specific Options dbext-configure-options The command terminator is automatically added to a command before it is sent to the database. The command options are also added to the command line used to execute the statement. >
dbext_default_SQLSRV_bin = "osql" dbext_default_SQLSRV_cmd_header = "" dbext_default_SQLSRV_cmd_terminator = "\ngo\n" dbext_default_SQLSRV_cmd_options = '-w 10000 -r -b -n' dbext_default_SQLSRV_extra = ''
So, to permanently override for all buffers in your .vimrc you would add:
let g:dbext_default_SQLSRV_cmd_terminator = ";"