You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+7-4
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,9 @@ The `sqlcmd` project aims to be a complete port of the original ODBC sqlcmd to t
121
121
122
122
### Changes in behavior from the ODBC based sqlcmd
123
123
124
+
-`/` is not accepted as a flag specifier, only `-`
125
+
- There are new posix-style versions of each flag, such as `--input-file` for `-i`. `sqlcmd -?` will print those parameter names. Those new names do not preserve backward compatibility with ODBC `sqlcmd`. For example, to specify multiple input file names using `--input-file`, the file names must be comma-delimited, not space-delimited.
126
+
124
127
The following switches have different behavior in this version of `sqlcmd` compared to the original ODBC based `sqlcmd`.
125
128
-`-r` requires a 0 or 1 argument
126
129
-`-R` switch is ignored. The go runtime does not provide access to user locale information, and it's not readily available through syscall on all supported platforms.
@@ -133,19 +136,19 @@ The following switches have different behavior in this version of `sqlcmd` compa
133
136
-`-u` The generated Unicode output file will have the UTF16 Little-Endian Byte-order mark (BOM) written to it.
134
137
- Some behaviors that were kept to maintain compatibility with `OSQL` may be changed, such as alignment of column headers for some data types.
135
138
- All commands must fit on one line, even `EXIT`. Interactive mode will not check for open parentheses or quotes for commands and prompt for successive lines. The ODBC sqlcmd allows the query run by `EXIT(query)` to span multiple lines.
136
-
-`-i` now requires multiple arguments for the switch to be separated by `,`.
137
-
-`-v` requires multiple variable setters to be comma-separated. eg: `-v var1=v1,var2=v2 -v "var3=v 3"`
139
+
-`-i` doesn't handle a comma `,` in a file name correctly unless the file name argument is triple quoted. For example:
140
+
`sqlcmd -i """select,100.sql"""` will try to open a file named `sql,100.sql` while `sqlcmd -i "select,100.sql"` will try to open two files `select` and `100.sql`
141
+
- If using a single `-i` flag to pass multiple file names, there must be a space after the `-i`. Example: `-i file1.sql file2.sql`
138
142
-`-M` switch is ignored. Sqlcmd always enables multi-subnet failover.
139
143
144
+
140
145
### Switches not available in the new sqlcmd (go-sqlcmd) yet
141
146
142
147
There are a few switches yet to be implemented in the new `sqlcmd` (go-sqlcmd) compared
143
148
to the original ODBC based `sqlcmd`, discussion [#293](https://github.com/microsoft/go-sqlcmd/discussions/292)
144
149
lists these switches. Please provide feedback in the discussion on which
145
150
switches are most important to you to have implemented next in the new sqlcmd.
146
151
147
-
Also, the XML Output command `:XML [On]|[Off]` is not implemented yet
0 commit comments