Skip to content

Commit

Permalink
Execute stored procedures through RPC even when there isn't any param…
Browse files Browse the repository at this point in the history
…eter (denisenkom#676)
  • Loading branch information
tc-hib authored Jul 15, 2021
1 parent e65e9ba commit 9e2f833
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ func (s *Stmt) sendQuery(args []namedValue) (err error) {

reset := conn.resetSession
conn.resetSession = false
if len(args) == 0 {
isProc := isProc(s.query)
if len(args) == 0 && !isProc {
if err = sendSqlBatch72(conn.sess.buf, s.query, headers, reset); err != nil {
if conn.sess.logFlags&logErrors != 0 {
conn.sess.log.Printf("Failed to send SqlBatch with %v", err)
Expand All @@ -481,7 +482,7 @@ func (s *Stmt) sendQuery(args []namedValue) (err error) {
} else {
proc := sp_ExecuteSql
var params []param
if isProc(s.query) {
if isProc {
proc.name = s.query
params, _, err = s.makeRPCParams(args, true)
if err != nil {
Expand Down

0 comments on commit 9e2f833

Please sign in to comment.