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
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5017
+
5018
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5019
+
5020
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copy file name to clipboardExpand all lines: README.md
+23-6Lines changed: 23 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,28 @@ We will be implementing command line switches and behaviors over time. Several s
34
34
- The new `--driver-logging-level` command line parameter allows you to see traces from the `go-mssqldb` client driver. Use `64` to see all traces.
35
35
- Sqlcmd can now print results using a vertical format. Use the new `-F vertical` command line option to set it. It's also controlled by the `SQLCMDFORMAT` scripting variable.
36
36
37
+
```
38
+
39
+
1> select session_id, client_interface_name, program_name from sys.dm_exec_sessions where session_id=@@spid
40
+
2> go
41
+
session_id 58
42
+
client_interface_name go-mssqldb
43
+
program_name sqlcmd
44
+
45
+
```
46
+
- Sqlcmd now supports shared memory and named pipe transport. Use the appropriate protocol prefix on the server name to force a protocol
47
+
*`lpc` for shared memory, only for a localhost. `sqlcmd -S lpc:.`
48
+
*`np` for named pipes. Or use the UNC named pipe path as the server name: `sqlcmd -S \\myserver\pipe\sql\query`
49
+
*`tcp` for tcp `sqlcmd -S tcp:myserver,1234`
50
+
If no protocol is specified, sqlcmd will attempt to dial in this order: lpc->np->tcp. If dialing a remote host, `lpc` will be skipped.
51
+
52
+
```
53
+
1> select net_transport from sys.dm_exec_connections where session_id=@@spid
54
+
2> go
55
+
net_transport Named pipe
56
+
57
+
```
58
+
37
59
### Azure Active Directory Authentication
38
60
39
61
This version of sqlcmd supports a broader range of AAD authentication models, based on the [azidentity package](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity). The implementation relies on an AAD Connector in the [driver](https://github.com/microsoft/go-mssqldb).
@@ -105,18 +127,13 @@ pkg/sqlcmd is consumable by other hosts. Go docs for the package are forthcoming
105
127
106
128
## Building
107
129
108
-
To add version data to your build using `go-winres`, add `GOBIN` to your `PATH` then use `go generate`
109
-
The version on the binary will match the version tag of the branch.
110
130
111
131
```sh
112
132
113
-
go install github.com/tc-hib/go-winres@latest
114
-
cd cmd/modern
115
-
go generate
133
+
build/build
116
134
117
135
```
118
136
119
-
Scripts to build the binaries and package them for release will be added in a build folder off the root. We will also add Azure Devops pipeline yml files there to initiate builds and releases. Until then just use `go build ./cmd/sqlcmd` to create a sqlcmd binary.
Copy file name to clipboardExpand all lines: cmd/sqlcmd/sqlcmd.go
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ type SQLCmdArguments struct {
32
32
InitialQuerystring`short:"q" xor:"input1" help:"Executes a query when sqlcmd starts, but does not exit sqlcmd when the query has finished running. Multiple-semicolon-delimited queries can be executed."`
33
33
// Query to run then exit
34
34
Querystring`short:"Q" xor:"input2" help:"Executes a query when sqlcmd starts and then immediately exits sqlcmd. Multiple-semicolon-delimited queries can be executed."`
35
-
Serverstring`short:"S" help:"[tcp:]server[\\instance_name][,port]Specifies the instance of SQL Server to which to connect. It sets the sqlcmd scripting variable SQLCMDSERVER."`
35
+
Serverstring`short:"S" help:"[[tcp:]|[lpc:]|[np:]]server[\\instance_name][,port]Specifies the instance of SQL Server to which to connect. It sets the sqlcmd scripting variable SQLCMDSERVER."`
36
36
// Disable syscommands with a warning
37
37
DisableCmdAndWarnbool`short:"X" xor:"syscmd" help:"Disables commands that might compromise system security. Sqlcmd issues a warning and continues."`
0 commit comments