Skip to content

Commit f5fd314

Browse files
committed
Fix: use TSQLQuoter for column names escaping in bulkcopy
1 parent a3c775d commit f5fd314

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bulkcopy.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,12 @@ func (b *Bulk) sendBulkCommand(ctx context.Context) (err error) {
9898

9999
//columns definitions
100100
var col_defs bytes.Buffer
101+
q := TSQLQuoter{}
101102
for i, col := range b.bulkColumns {
102103
if i != 0 {
103104
col_defs.WriteString(", ")
104105
}
105-
col_defs.WriteString("[" + col.ColName + "] " + makeDecl(col.ti))
106+
col_defs.WriteString(q.ID(col.ColName) + " " + makeDecl(col.ti))
106107
}
107108

108109
//options

0 commit comments

Comments
 (0)