Thanks for the article, nice introduction to a tool I've never used.
One problem I noticed when trying it out is that entries in the error file have no context so it's impossible to tell which statements generated the errors.
Let me explain; I created a simple script which connects to a server and db, sets the :error and :out variables and runs a succession of script files using the :r command. When I checked the error file afterwards it contained lines like this:
Msg 102, Level 15, State 1, Server foo, Line 5
Incorrect syntax near 'dbo'.
but there was nothing to say whether that error was a result of statements in the script or in one of the files called by :r
Is there a way to add context to the error file? I don't want to have to use many different error files...