microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
323 stars 57 forks source link

Restore -I as a no-op #394

Closed sommarskog closed 1 year ago

sommarskog commented 1 year ago

go-sqlcmd connects with SET QUOTED_IDENTIFIER ON which is a good thing. This removes the need of the -I option that the old SQLCMD has, and therefore this option has been dropped.

However, I don't think this was a wise move. Say that you have a BAT file that loads SQL objects with SQLCMD. This BAT file may execute on multiple machines, and you have no control over which SQLCMD that is installed on the individual machine (or which comes first in the path).

If you leave -I on the SQLCMD command line, the script will fail on computers with go-sqlcmd.

If you take out -I, the script will load SQL objects with QUJOTED_IDENTIFIER OFF on machines with the old SQLCMD. This can leads to all sorts of problem.

Therefore, go-sqlcmd should accept -I as an option, but it should not affect anything. But just not cause an error.

shueybubbles commented 1 year ago

Agree, we can put the argument back as a no-op