osql -Umyuser -Pmypasswd -d mydbname -i scripttorun.sql -o inserts.log
There's also isql (is using same syntax), which doesn't support unicode scripts and doesn't use ODBC to connect. That might be faster in certain cases, thou i haven't experienced any performance difference.