Repository: microsoft/go-mssqldb
Pull request #20 (2022-05-19 20:04:13)

Merge denisenkom to microsoft


Patch:
diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml
deleted file mode 100644
index 8c3a92c..0000000
--- a/.github/workflows/pr-validation.yml
+++ /dev/null
@@ -1,33 +0,0 @@
-name: pr-validation
-
-on:
-  pull_request:
-    branches:
-    - main
-
-jobs:
-  build:
-    runs-on: ubuntu-latest
-    strategy:
-      matrix:
-        go: ['1.16','1.17', '1.18']
-        sqlImage: ['2017-latest','2019-latest']
-    steps:
-    - uses: actions/checkout@v2
-    - name: Setup go
-      uses: actions/setup-go@v2
-      with:
-        go-version: '${{ matrix.go }}'
-    - name: Run tests against Linux SQL
-      run: |
-        go version
-        go get -d
-        export SQLCMDPASSWORD=$(date +%s|sha256sum|base64|head -c 32)
-        export SQLCMDUSER=sa
-        export SQLUSER=sa
-        export SQLPASSWORD=$SQLCMDPASSWORD
-        export DATABASE=test
-        docker run -m 2GB -e ACCEPT_EULA=1 -d --name sqlserver -p:1433:1433 -e SA_PASSWORD=$SQLCMDPASSWORD mcr.microsoft.com/mssql/server:${{ matrix.sqlImage }}
-        sleep 10
-        sqlcmd -Q "CREATE DATABASE test"
-        go test -race -cpu 4 ./...
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index c282e9a..0000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# Contributing
-
-This project welcomes contributions and suggestions. Most contributions require you to
-agree to a Contributor License Agreement (CLA) declaring that you have the right to,
-and actually do, grant us the rights to use your contribution. For details, visit
-https://cla.microsoft.com.
-
-When you submit a pull request, a CLA-bot will automatically determine whether you need
-to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
-instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
-
-This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
-For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
-or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
\ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE.txt
index 700e114..7448756 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,5 +1,4 @@
 Copyright (c) 2012 The Go Authors. All rights reserved.
-Copyright (c) Microsoft Corporation.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
diff --git a/README.md b/README.md
index 59dc8a5..9a2a9bb 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
 # A pure Go MSSQL driver for Go's database/sql package
 
-[![Go Reference](https://pkg.go.dev/badge/github.com/microsoft/go-mssqldb.svg)](https://pkg.go.dev/github.com/microsoft/go-mssqldb)
-[![Build status](https://ci.appveyor.com/api/projects/status/jrln8cs62wj9i0a2?svg=true)](https://ci.appveyor.com/project/microsoft/go-mssqldb)
-[![codecov](https://codecov.io/gh/microsoft/go-mssqldb/branch/master/graph/badge.svg)](https://codecov.io/gh/microsoft/go-mssqldb)
+[![Go Reference](https://pkg.go.dev/badge/github.com/denisenkom/go-mssqldb.svg)](https://pkg.go.dev/github.com/denisenkom/go-mssqldb)
+[![Build status](https://ci.appveyor.com/api/projects/status/jrln8cs62wj9i0a2?svg=true)](https://ci.appveyor.com/project/denisenkom/go-mssqldb)
+[![codecov](https://codecov.io/gh/denisenkom/go-mssqldb/branch/master/graph/badge.svg)](https://codecov.io/gh/denisenkom/go-mssqldb)
 
 ## Install
 
 Requires Go 1.8 or above.
 
-Install with `go get github.com/microsoft/go-mssqldb` .
+Install with `go get github.com/denisenkom/go-mssqldb` .
 
 ## Connection Parameters and DSN
 
@@ -140,7 +140,7 @@ import (
   "net/url"
 
   // Import the Azure AD driver module (also imports the regular driver package)
-  "github.com/microsoft/go-mssqldb/azuread"
+  "github.com/denisenkom/go-mssqldb/azuread"
 )
 
 func ConnectWithMSI() (*sql.DB, error) {
@@ -280,16 +280,6 @@ are supported:
 * "github.com/golang-sql/civil".Time -> time
 * mssql.TVP -> Table Value Parameter (TDS version dependent)
 
-```go
-// If this is passed directly as a parameter, 
-// the SQL parameter generated would be nvarchar
-name := "Bob"
-// If the user_name is defined as varchar,
-// it needs to be converted like this:
-db.QueryContext(ctx, `select * from t2 where user_name = @p1;`, mssql.VarChar(name))
-// Note: Mismatched data types on table and parameter may cause long running queries
-```
-
 ## Important Notes
 
 * [LastInsertId](https://golang.org/pkg/database/sql/#Result.LastInsertId) should
@@ -298,9 +288,9 @@ db.QueryContext(ctx, `select * from t2 where user_name = @p1;`, mssql.VarChar(na
  or add a `select ID = convert(bigint, SCOPE_IDENTITY());` to the end of your
  query (ref [SCOPE_IDENTITY](https://docs.microsoft.com/en-us/sql/t-sql/functions/scope-identity-transact-sql)).
  This will ensure you are getting the correct ID and will prevent a network round trip.
-* [NewConnector](https://godoc.org/github.com/microsoft/go-mssqldb#NewConnector)
+* [NewConnector](https://godoc.org/github.com/denisenkom/go-mssqldb#NewConnector)
     may be used with [OpenDB](https://golang.org/pkg/database/sql/#OpenDB).
-* [Connector.SessionInitSQL](https://godoc.org/github.com/microsoft/go-mssqldb#Connector.SessionInitSQL)
+* [Connector.SessionInitSQL](https://godoc.org/github.com/denisenkom/go-mssqldb#Connector.SessionInitSQL)
  may be set to set any driver specific session settings after the session
  has been reset. If empty the session will still be reset but use the database
  defaults in Go1.10+.
@@ -356,20 +346,3 @@ Use the native "@Name" parameters instead with the "sqlserver" driver name.
 To fix SQL Server 2008 R2 issue, install SQL Server 2008 R2 Service Pack 2.
 To fix SQL Server 2008 issue, install Microsoft SQL Server 2008 Service Pack 3 and Cumulative update package 3 for SQL Server 2008 SP3.
 More information: <http://support.microsoft.com/kb/2653857>
-
-
-# Contributing
-This project is a fork of [https://github.com/denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) and welcomes new and previous contributors. For more informaton on contributing to this project, please see [Contributing](./CONTRIBUTING.md).
-
-For more information on the roadmap for go-mssqldb, [project plans](https://github.com/microsoft/go-mssqldb/projects) are available for viewing and discussion.
-
-
-# Microsoft Open Source Code of Conduct
-
-This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
-
-Resources:
-
-- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
-- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
-- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
diff --git a/SECURITY.md b/SECURITY.md
deleted file mode 100644
index f7b8998..0000000
--- a/SECURITY.md
+++ /dev/null
@@ -1,41 +0,0 @@
-<!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
-
-## Security
-
-Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
-
-If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
-
-## Reporting Security Issues
-
-**Please do not report security vulnerabilities through public GitHub issues.**
-
-Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
-
-If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com).  If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
-
-You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 
-
-Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
-
-  * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
-  * Full paths of source file(s) related to the manifestation of the issue
-  * The location of the affected source code (tag/branch/commit or direct URL)
-  * Any special configuration required to reproduce the issue
-  * Step-by-step instructions to reproduce the issue
-  * Proof-of-concept or exploit code (if possible)
-  * Impact of the issue, including how an attacker might exploit the issue
-
-This information will help us triage your report more quickly.
-
-If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
-
-## Preferred Languages
-
-We prefer all communications to be in English.
-
-## Policy
-
-Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
-
-<!-- END MICROSOFT SECURITY.MD BLOCK -->
\ No newline at end of file
diff --git a/appveyor.yml b/appveyor.yml
index 2d91ebb..c03f375 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -3,7 +3,7 @@ version: 1.0.{build}
 image:
   - Visual Studio 2015
 
-clone_folder: c:\gopath\src\github.com\microsoft\go-mssqldb
+clone_folder: c:\gopath\src\github.com\denisenkom\go-mssqldb
 
 environment:
   GOPATH: c:\gopath
diff --git a/azuread/configuration.go b/azuread/configuration.go
index 33e5afd..a6e30e9 100644
--- a/azuread/configuration.go
+++ b/azuread/configuration.go
@@ -9,8 +9,8 @@ import (
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore"
 	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
 	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
-	mssql "github.com/microsoft/go-mssqldb"
-	"github.com/microsoft/go-mssqldb/msdsn"
+	mssql "github.com/denisenkom/go-mssqldb"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 const (
diff --git a/azuread/driver.go b/azuread/driver.go
index 01d3da4..fa41757 100644
--- a/azuread/driver.go
+++ b/azuread/driver.go
@@ -5,7 +5,7 @@ import (
 	"database/sql"
 	"database/sql/driver"
 
-	mssql "github.com/microsoft/go-mssqldb"
+	mssql "github.com/denisenkom/go-mssqldb"
 )
 
 // DriverName is the name used to register the driver
diff --git a/bulkcopy.go b/bulkcopy.go
index dcfccbf..f6cf97a 100644
--- a/bulkcopy.go
+++ b/bulkcopy.go
@@ -11,8 +11,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/microsoft/go-mssqldb/internal/decimal"
-	"github.com/microsoft/go-mssqldb/msdsn"
+	"github.com/denisenkom/go-mssqldb/internal/decimal"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 type Bulk struct {
diff --git a/doc/how-to-perform-bulk-imports.md b/doc/how-to-perform-bulk-imports.md
index 3ac3dcc..f8c0a3a 100644
--- a/doc/how-to-perform-bulk-imports.md
+++ b/doc/how-to-perform-bulk-imports.md
@@ -5,7 +5,7 @@ To use the bulk imports feature in go-mssqldb, you need to import the sql and go
 ```
 import (
     "database/sql"
-    "github.com/microsoft/go-mssqldb"
+    "github.com/denisenkom/go-mssqldb"
 )
 ```
 
diff --git a/doc/how-to-use-newconnector.md b/doc/how-to-use-newconnector.md
index cd89414..0273d89 100644
--- a/doc/how-to-use-newconnector.md
+++ b/doc/how-to-use-newconnector.md
@@ -7,7 +7,7 @@ To use the Connector type, first you need to import the sql and go-mssqldb packa
 ```
 import (
   "database/sql"
-  "github.com/microsoft/go-mssqldb"
+  "github.com/denisenkom/go-mssqldb"
 )
 ```
 
diff --git a/error.go b/error.go
index 09964b8..e60288a 100644
--- a/error.go
+++ b/error.go
@@ -27,6 +27,10 @@ func (e Error) Error() string {
 	return "mssql: " + e.Message
 }
 
+func (e Error) String() string {
+	return e.Message
+}
+
 // SQLErrorNumber returns the SQL Server error number.
 func (e Error) SQLErrorNumber() int32 {
 	return e.Number
diff --git a/examples/azuread-accesstoken/go.mod b/examples/azuread-accesstoken/go.mod
index cee1784..eb113f3 100644
--- a/examples/azuread-accesstoken/go.mod
+++ b/examples/azuread-accesstoken/go.mod
@@ -1,8 +1,8 @@
-module github.com/microsoft/go-mssqldb/examples/azure-ad-accesstoken
+module github.com/denisenkom/go-mssqldb/examples/azure-ad-accesstoken
 
 go 1.13
 
 require (
 	github.com/Azure/go-autorest/autorest/adal v0.8.1
-	github.com/microsoft/go-mssqldb v0.12.0
+	github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73
 )
diff --git a/examples/azuread-accesstoken/go.sum b/examples/azuread-accesstoken/go.sum
index 432407e..17148ff 100644
--- a/examples/azuread-accesstoken/go.sum
+++ b/examples/azuread-accesstoken/go.sum
@@ -14,8 +14,8 @@ github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN
 github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
 github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k=
 github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
-github.com/microsoft/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73 h1:OGNva6WhsKst5OZf7eZOklDztV3hwtTHovdrLHV+MsA=
-github.com/microsoft/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
+github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73 h1:OGNva6WhsKst5OZf7eZOklDztV3hwtTHovdrLHV+MsA=
+github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
 github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
 github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
 github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
diff --git a/examples/azuread-accesstoken/managed_identity.go b/examples/azuread-accesstoken/managed_identity.go
index 6ff3617..0adf99c 100644
--- a/examples/azuread-accesstoken/managed_identity.go
+++ b/examples/azuread-accesstoken/managed_identity.go
@@ -7,7 +7,7 @@ import (
 	"log"
 
 	"github.com/Azure/go-autorest/autorest/adal"
-	mssql "github.com/microsoft/go-mssqldb"
+	mssql "github.com/denisenkom/go-mssqldb"
 )
 
 var (
diff --git a/examples/bulk/bulk.go b/examples/bulk/bulk.go
index bcd6e99..8ce1238 100644
--- a/examples/bulk/bulk.go
+++ b/examples/bulk/bulk.go
@@ -6,7 +6,7 @@ import (
 	"fmt"
 	"log"
 
-	mssql "github.com/microsoft/go-mssqldb"
+	"github.com/denisenkom/go-mssqldb"
 )
 
 var (
diff --git a/examples/routine/routine.go b/examples/routine/routine.go
index 42f6513..3c9cf74 100644
--- a/examples/routine/routine.go
+++ b/examples/routine/routine.go
@@ -8,7 +8,7 @@ import (
 	"strconv"
 	"sync"
 
-	_ "github.com/microsoft/go-mssqldb"
+	_ "github.com/denisenkom/go-mssqldb"
 )
 
 var (
diff --git a/examples/simple/simple.go b/examples/simple/simple.go
index 7cb5cfc..67f88aa 100644
--- a/examples/simple/simple.go
+++ b/examples/simple/simple.go
@@ -6,7 +6,7 @@ import (
 	"fmt"
 	"log"
 
-	_ "github.com/microsoft/go-mssqldb"
+	_ "github.com/denisenkom/go-mssqldb"
 )
 
 var (
diff --git a/examples/tsql/tsql.go b/examples/tsql/tsql.go
index 69dc8d4..f90cf46 100644
--- a/examples/tsql/tsql.go
+++ b/examples/tsql/tsql.go
@@ -9,7 +9,7 @@ import (
 	"os"
 	"time"
 
-	_ "github.com/microsoft/go-mssqldb"
+	_ "github.com/denisenkom/go-mssqldb"
 )
 
 func main() {
diff --git a/examples/tvp/tvp.go b/examples/tvp/tvp.go
index 061b7f3..a07bb65 100644
--- a/examples/tvp/tvp.go
+++ b/examples/tvp/tvp.go
@@ -4,9 +4,8 @@ import (
 	"database/sql"
 	"flag"
 	"fmt"
+	"github.com/denisenkom/go-mssqldb"
 	"log"
-
-	mssql "github.com/microsoft/go-mssqldb"
 )
 
 var (
diff --git a/fedauth.go b/fedauth.go
index 27ff3fc..cd74cb5 100644
--- a/fedauth.go
+++ b/fedauth.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"errors"
 
-	"github.com/microsoft/go-mssqldb/msdsn"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 // Federated authentication library affects the login data structure and message sequence.
diff --git a/go.mod b/go.mod
index 562681d..13c4d25 100644
--- a/go.mod
+++ b/go.mod
@@ -1,11 +1,11 @@
-module github.com/microsoft/go-mssqldb
+module github.com/denisenkom/go-mssqldb
 
-go 1.11
+go 1.13
 
 require (
 	github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0
 	github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0
 	github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe
-	github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188
+	github.com/golang-sql/sqlexp v0.1.0
 	golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
 )
diff --git a/go.sum b/go.sum
index f8a505f..f4f14f6 100644
--- a/go.sum
+++ b/go.sum
@@ -12,6 +12,8 @@ github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZ
 github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
 github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4=
 github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8=
+github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
+github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
 github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
 github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98=
 github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
diff --git a/log.go b/log.go
index 8ccb403..8d99bd5 100644
--- a/log.go
+++ b/log.go
@@ -3,7 +3,7 @@ package mssql
 import (
 	"context"
 
-	"github.com/microsoft/go-mssqldb/msdsn"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 const (
diff --git a/msdsn/conn_str.go b/msdsn/conn_str.go
index d85f086..40bedb0 100644
--- a/msdsn/conn_str.go
+++ b/msdsn/conn_str.go
@@ -80,7 +80,7 @@ func SetupTLS(certificate string, insecureSkipVerify bool, hostInCertificate str
 		ServerName:         hostInCertificate,
 		InsecureSkipVerify: insecureSkipVerify,
 
-		// fix for https://github.com/microsoft/go-mssqldb/issues/166
+		// fix for https://github.com/denisenkom/go-mssqldb/issues/166
 		// Go implementation of TLS payload size heuristic algorithm splits single TDS package to multiple TCP segments,
 		// while SQL Server seems to expect one TCP segment per encrypted TDS package.
 		// Setting DynamicRecordSizingDisabled to true disables that algorithm and uses 16384 bytes per TLS package
diff --git a/mssql.go b/mssql.go
index 68925da..fbd44d1 100644
--- a/mssql.go
+++ b/mssql.go
@@ -15,9 +15,9 @@ import (
 	"time"
 	"unicode"
 
+	"github.com/denisenkom/go-mssqldb/internal/querytext"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 	"github.com/golang-sql/sqlexp"
-	"github.com/microsoft/go-mssqldb/internal/querytext"
-	"github.com/microsoft/go-mssqldb/msdsn"
 )
 
 // ReturnStatus may be used to return the return value from a proc.
@@ -1074,6 +1074,7 @@ type Rowsq struct {
 	stmt        *Stmt
 	cols        []columnStruct
 	reader      *tokenProcessor
+	nextCols    []columnStruct
 	cancel      func()
 	requestDone bool
 	inResultSet bool
@@ -1101,11 +1102,8 @@ func (rc *Rowsq) Close() error {
 	}
 }
 
-// ProcessSingleResponse queues MsgNext for every columns token.
-// data/sql calls Columns during the app's call to Next.
+// data/sql calls Columns during the app's call to Next
 func (rc *Rowsq) Columns() (res []string) {
-	// r.cols is nil if the first query in a batch is a SELECT or similar query that returns a rowset.
-	// if will be non-nil for subsequent queries where NextResultSet() has populated it
 	if rc.cols == nil {
 	scan:
 		for {
@@ -1147,10 +1145,6 @@ func (rc *Rowsq) Next(dest []driver.Value) error {
 			if tok == nil {
 				return io.EOF
 			} else {
-				switch tokdata := tok.(type) {
-				case doneInProcStruct:
-					tok = (doneStruct)(tokdata)
-				}
 				switch tokdata := tok.(type) {
 				case []interface{}:
 					for i := range dest {
@@ -1178,11 +1172,9 @@ func (rc *Rowsq) Next(dest []driver.Value) error {
 					if rc.reader.outs.returnStatus != nil {
 						*rc.reader.outs.returnStatus = tokdata
 					}
-				case ServerError:
-					rc.requestDone = true
-					return tokdata
 				}
 			}
+
 		} else {
 			return rc.stmt.c.checkBadConn(rc.reader.ctx, err, false)
 		}
@@ -1195,7 +1187,7 @@ func (rc *Rowsq) HasNextResultSet() bool {
 	return !rc.requestDone
 }
 
-// Scans to the end of the current statement being processed
+// Scans to the next set of columns in the stream
 // Note that the caller may not have read all the rows in the prior set
 func (rc *Rowsq) NextResultSet() error {
 	if rc.requestDone {
@@ -1203,6 +1195,7 @@ func (rc *Rowsq) NextResultSet() error {
 	}
 scan:
 	for {
+		// we should have a columns token in the channel if we aren't at the end
 		tok, err := rc.reader.nextToken()
 		if rc.reader.sess.logFlags&logDebug != 0 {
 			rc.reader.sess.logger.Log(rc.reader.ctx, msdsn.LogDebug, fmt.Sprintf("NextResultSet() token type:%v", reflect.TypeOf(tok)))
@@ -1215,42 +1208,23 @@ scan:
 			return io.EOF
 		}
 		switch tokdata := tok.(type) {
-		case doneInProcStruct:
-			tok = (doneStruct)(tokdata)
-		}
-		// ProcessSingleResponse queues a MsgNextResult for every "done" and "server error" token
-		// The only tokens to consume after a "done" should be "done", "server error", or "columns"
-		switch tokdata := tok.(type) {
 		case []columnStruct:
-			rc.cols = tokdata
+			rc.nextCols = tokdata
 			rc.inResultSet = true
 			break scan
 		case doneStruct:
 			if tokdata.Status&doneMore == 0 {
+				rc.nextCols = nil
 				rc.requestDone = true
+				break scan
 			}
-			if tokdata.isError() {
-				e := rc.stmt.c.checkBadConn(rc.reader.ctx, tokdata.getError(), false)
-				switch e.(type) {
-				case Error:
-					// Ignore non-fatal server errors. Fatal errors are of type ServerError
-				default:
-					return e
-				}
-			}
-			rc.inResultSet = false
-			rc.cols = nil
-			break scan
-		case ReturnStatus:
-			if rc.reader.outs.returnStatus != nil {
-				*rc.reader.outs.returnStatus = tokdata
-			}
-		case ServerError:
-			rc.requestDone = true
-			return tokdata
 		}
 	}
-
+	rc.cols = rc.nextCols
+	rc.nextCols = nil
+	if rc.cols == nil {
+		return io.EOF
+	}
 	return nil
 }
 
diff --git a/tds.go b/tds.go
index b6d9bc9..dbe9527 100644
--- a/tds.go
+++ b/tds.go
@@ -16,7 +16,7 @@ import (
 	"unicode/utf16"
 	"unicode/utf8"
 
-	"github.com/microsoft/go-mssqldb/msdsn"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 func parseInstances(msg []byte) map[string]map[string]string {
@@ -1142,7 +1142,7 @@ initiate_connection:
 			if config.DynamicRecordSizingDisabled == false {
 				config = config.Clone()
 
-				// fix for https://github.com/microsoft/go-mssqldb/issues/166
+				// fix for https://github.com/denisenkom/go-mssqldb/issues/166
 				// Go implementation of TLS payload size heuristic algorithm splits single TDS package to multiple TCP segments,
 				// while SQL Server seems to expect one TCP segment per encrypted TDS package.
 				// Setting DynamicRecordSizingDisabled to true disables that algorithm and uses 16384 bytes per TLS package
diff --git a/token.go b/token.go
index 738e3ee..61c88fc 100644
--- a/token.go
+++ b/token.go
@@ -9,8 +9,8 @@ import (
 	"io/ioutil"
 	"strconv"
 
+	"github.com/denisenkom/go-mssqldb/msdsn"
 	"github.com/golang-sql/sqlexp"
-	"github.com/microsoft/go-mssqldb/msdsn"
 )
 
 //go:generate go run golang.org/x/tools/cmd/stringer -type token
@@ -49,20 +49,6 @@ const (
 	doneSrvError = 0x100
 )
 
-// CurCmd values in done (undocumented)
-const (
-	cmdSelect = 0xc1
-	// cmdInsert     = 0xc3
-	// cmdDelete     = 0xc4
-	// cmdUpdate     = 0xc5
-	// cmdAbort      = 0xd2
-	// cmdBeginXaxt  = 0xd4
-	// cmdEndXact    = 0xd5
-	// cmdBulkInsert = 0xf0
-	// cmdOpenCursor = 0x20
-	// cmdMerge      = 0x117
-)
-
 // ENVCHANGE types
 // http://msdn.microsoft.com/en-us/library/dd303449.aspx
 const (
@@ -659,6 +645,7 @@ func parseReturnValue(r *tdsBuffer) (nv namedValue) {
 }
 
 func processSingleResponse(ctx context.Context, sess *tdsSession, ch chan tokenStruct, outs outputs) {
+	firstResult := true
 	defer func() {
 		if err := recover(); err != nil {
 			if sess.logFlags&logErrors != 0 {
@@ -668,7 +655,7 @@ func processSingleResponse(ctx context.Context, sess *tdsSession, ch chan tokenS
 		}
 		close(ch)
 	}()
-	colsReceived := false
+
 	packet_type, err := sess.buf.BeginRead()
 	if err != nil {
 		if sess.logFlags&logErrors != 0 {
@@ -710,26 +697,18 @@ func processSingleResponse(ctx context.Context, sess *tdsSession, ch chan tokenS
 			done := parseDoneInProc(sess.buf)
 
 			ch <- done
-			if done.Status&doneCount != 0 {
-				if sess.logFlags&logRows != 0 {
-					sess.logger.Log(ctx, msdsn.LogRows, fmt.Sprintf("(%d rows affected)", done.RowCount))
-				}
+			if sess.logFlags&logRows != 0 && done.Status&doneCount != 0 {
+				sess.logger.Log(ctx, msdsn.LogRows, fmt.Sprintf("(%d rows affected)", done.RowCount))
 
-				if (colsReceived || done.CurCmd != cmdSelect) && outs.msgq != nil {
+				if outs.msgq != nil {
 					_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgRowsAffected{Count: int64(done.RowCount)})
 				}
 			}
-			if outs.msgq != nil {
-				// For now we ignore ctx->Done errors that ReturnMessageEnqueue might return
-				// It's not clear how to handle them correctly here, and data/sql seems
-				// to set Rows.Err correctly when ctx expires already
-				_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgNextResultSet{})
-			}
-			colsReceived = false
 			if done.Status&doneMore == 0 {
-				// Rows marks the request as done when seeing this done token. We queue another result set message
-				// so the app calls NextResultSet again which will return false.
 				if outs.msgq != nil {
+					// For now we ignore ctx->Done errors that ReturnMessageEnqueue might return
+					// It's not clear how to handle them correctly here, and data/sql seems
+					// to set Rows.Err correctly when ctx expires already
 					_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgNextResultSet{})
 				}
 				return
@@ -750,24 +729,16 @@ func processSingleResponse(ctx context.Context, sess *tdsSession, ch chan tokenS
 				}
 				return
 			}
+			if sess.logFlags&logRows != 0 && done.Status&doneCount != 0 {
+				sess.logger.Log(ctx, msdsn.LogRows, fmt.Sprintf("(%d row(s) affected)", done.RowCount))
+			}
 			ch <- done
 			if done.Status&doneCount != 0 {
-				if sess.logFlags&logRows != 0 {
-					sess.logger.Log(ctx, msdsn.LogRows, fmt.Sprintf("(%d row(s) affected)", done.RowCount))
-				}
-
-				if (colsReceived || done.CurCmd != cmdSelect) && outs.msgq != nil {
+				if outs.msgq != nil {
 					_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgRowsAffected{Count: int64(done.RowCount)})
 				}
-
-			}
-			colsReceived = false
-			if outs.msgq != nil {
-				_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgNextResultSet{})
 			}
 			if done.Status&doneMore == 0 {
-				// Rows marks the request as done when seeing this done token. We queue another result set message
-				// so the app calls NextResultSet again which will return false.
 				if outs.msgq != nil {
 					_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgNextResultSet{})
 				}
@@ -776,10 +747,14 @@ func processSingleResponse(ctx context.Context, sess *tdsSession, ch chan tokenS
 		case tokenColMetadata:
 			columns = parseColMetadata72(sess.buf)
 			ch <- columns
-			colsReceived = true
+
 			if outs.msgq != nil {
+				if !firstResult {
+					_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgNextResultSet{})
+				}
 				_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgNext{})
 			}
+			firstResult = false
 
 		case tokenRow:
 			row := make([]interface{}, len(columns))
@@ -812,7 +787,7 @@ func processSingleResponse(ctx context.Context, sess *tdsSession, ch chan tokenS
 				sess.logger.Log(ctx, msdsn.LogMessages, info.Message)
 			}
 			if outs.msgq != nil {
-				_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgNotice{Message: info.Message})
+				_ = sqlexp.ReturnMessageEnqueue(ctx, outs.msgq, sqlexp.MsgNotice{Message: info})
 			}
 		case tokenReturnValue:
 			nv := parseReturnValue(sess.buf)
diff --git a/types.go b/types.go
index 8780341..822a7d8 100644
--- a/types.go
+++ b/types.go
@@ -10,8 +10,8 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/microsoft/go-mssqldb/internal/cp"
-	"github.com/microsoft/go-mssqldb/internal/decimal"
+	"github.com/denisenkom/go-mssqldb/internal/cp"
+	"github.com/denisenkom/go-mssqldb/internal/decimal"
 )
 
 // fixed-length data types
@@ -1543,13 +1543,13 @@ func makeGoLangTypePrecisionScale(ti typeInfo) (int64, int64, bool) {
 			panic("invalid size of DATETIMEN")
 		}
 	case typeDateTime2N:
-		return int64(ti.Prec), int64(ti.Scale), true
+		return 0, 0, false
 	case typeDateN:
 		return 0, 0, false
 	case typeTimeN:
-		return int64(ti.Prec), int64(ti.Scale), true
+		return 0, 0, false
 	case typeDateTimeOffsetN:
-		return int64(ti.Prec), int64(ti.Scale), true
+		return 0, 0, false
 	case typeBigVarBin:
 		return 0, 0, false
 	case typeVarChar:


Test patch:
diff --git a/azuread/azuread_test.go b/azuread/azuread_test.go
index e6e16e4..ba7de67 100644
--- a/azuread/azuread_test.go
+++ b/azuread/azuread_test.go
@@ -7,7 +7,7 @@ import (
 	"os"
 	"testing"
 
-	mssql "github.com/microsoft/go-mssqldb"
+	mssql "github.com/denisenkom/go-mssqldb"
 )
 
 func TestAzureSqlAuth(t *testing.T) {
diff --git a/azuread/configuration_test.go b/azuread/configuration_test.go
index 208f652..c58b8b8 100644
--- a/azuread/configuration_test.go
+++ b/azuread/configuration_test.go
@@ -3,8 +3,8 @@ package azuread
 import (
 	"testing"
 
-	mssql "github.com/microsoft/go-mssqldb"
-	"github.com/microsoft/go-mssqldb/msdsn"
+	mssql "github.com/denisenkom/go-mssqldb"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 func TestValidateParameters(t *testing.T) {
diff --git a/bulkimport_example_test.go b/bulkimport_example_test.go
index 5046c35..4fafbc9 100644
--- a/bulkimport_example_test.go
+++ b/bulkimport_example_test.go
@@ -9,7 +9,7 @@ import (
 	"strings"
 	"unicode/utf8"
 
-	mssql "github.com/microsoft/go-mssqldb"
+	mssql "github.com/denisenkom/go-mssqldb"
 )
 
 const (
diff --git a/datetimeoffset_example_test.go b/datetimeoffset_example_test.go
index 8267b6d..ad419c4 100644
--- a/datetimeoffset_example_test.go
+++ b/datetimeoffset_example_test.go
@@ -9,8 +9,8 @@ import (
 	"log"
 	"time"
 
+	mssql "github.com/denisenkom/go-mssqldb"
 	"github.com/golang-sql/civil"
-	mssql "github.com/microsoft/go-mssqldb"
 )
 
 // This example shows how to insert and retrieve date and time types data
diff --git a/log_test.go b/log_test.go
index 529e283..9ac86d7 100644
--- a/log_test.go
+++ b/log_test.go
@@ -8,7 +8,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/microsoft/go-mssqldb/msdsn"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 // bufLogger implements the Logger interface for testing purposes.
diff --git a/messages_example_test.go b/messages_example_test.go
index 99faf3f..37dc0e8 100644
--- a/messages_example_test.go
+++ b/messages_example_test.go
@@ -9,8 +9,8 @@ import (
 	"fmt"
 	"log"
 
+	mssql "github.com/denisenkom/go-mssqldb"
 	"github.com/golang-sql/sqlexp"
-	mssql "github.com/microsoft/go-mssqldb"
 )
 
 const (
diff --git a/mssql_test.go b/mssql_test.go
index 9c50b83..d1bab1b 100644
--- a/mssql_test.go
+++ b/mssql_test.go
@@ -10,7 +10,7 @@ import (
 	"reflect"
 	"testing"
 
-	"github.com/microsoft/go-mssqldb/msdsn"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 func TestBadOpen(t *testing.T) {
diff --git a/newconnector_example_test.go b/newconnector_example_test.go
index 28bfd5a..8dc74ba 100644
--- a/newconnector_example_test.go
+++ b/newconnector_example_test.go
@@ -12,7 +12,7 @@ import (
 	"net/url"
 	"strconv"
 
-	mssql "github.com/microsoft/go-mssqldb"
+	mssql "github.com/denisenkom/go-mssqldb"
 )
 
 var (
diff --git a/queries_go19_test.go b/queries_go19_test.go
index 88affa4..c1fabeb 100644
--- a/queries_go19_test.go
+++ b/queries_go19_test.go
@@ -1126,20 +1126,18 @@ func TestMessageQueue(t *testing.T) {
 	active := true
 
 	msgs := []interface{}{
-		sqlexp.MsgNotice{Message: "msg1"},
-		sqlexp.MsgNextResultSet{},
+		sqlexp.MsgNotice{Message: Error{Message: "msg1"}},
 		sqlexp.MsgNext{},
 		sqlexp.MsgRowsAffected{Count: 1},
-		sqlexp.MsgNextResultSet{},
-		sqlexp.MsgNotice{Message: "msg2"},
-		sqlexp.MsgNextResultSet{},
+		sqlexp.MsgNotice{Message: Error{Message: "msg2"}},
 		sqlexp.MsgNextResultSet{},
 	}
 	i := 0
+	rsCount := 0
 	for active {
 		msg := retmsg.Message(ctx)
 		if i >= len(msgs) {
-			t.Fatalf("Got extra message:%+v", reflect.TypeOf(msg))
+			t.Fatalf("Got extra message:%+v", msg)
 		}
 		t.Log(reflect.TypeOf(msg))
 		if reflect.TypeOf(msgs[i]) != reflect.TypeOf(msg) {
@@ -1150,6 +1148,10 @@ func TestMessageQueue(t *testing.T) {
 			t.Log(m.Message)
 		case sqlexp.MsgNextResultSet:
 			active = rows.NextResultSet()
+			if active {
+				t.Fatal("NextResultSet returned true")
+			}
+			rsCount++
 		case sqlexp.MsgNext:
 			if !rows.Next() {
 				t.Fatal("rows.Next() returned false")
@@ -1236,8 +1238,7 @@ select getdate()
 PRINT N'This is a message'
 select 199
 RAISERROR (N'Testing!' , 11, 1)
-declare @d int = 300
-select @d
+select 300
 `
 
 func testMixedQuery(conn *sql.DB, b testing.TB) (msgs, errs, results, rowcounts int) {
@@ -1368,135 +1369,3 @@ func TestCancelWithNoResults(t *testing.T) {
 		t.Fatalf("Unexpected error: %v", r.Err())
 	}
 }
-
-const DropSprocWithCursor = `IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TestSqlCmd]') AND type in (N'P', N'PC'))
-DROP PROCEDURE [dbo].[TestSqlCmd]
-`
-
-// This query generates half a dozen tokenDoneInProc tokens which fill the channel if the app isn't scanning Rowsq
-const CreateSprocWithCursor = `
-CREATE PROCEDURE [dbo].[TestSqlCmd]
-AS
-BEGIN
-	DECLARE @tmp int;
-	DECLARE Server_Cursor CURSOR FOR
-	SELECT 1 UNION SELECT 2
-	OPEN Server_Cursor;
-	FETCH NEXT FROM Server_Cursor INTO @tmp;
-	WHILE @@FETCH_STATUS = 0
-		BEGIN
-		    PRINT @tmp
-			FETCH NEXT FROM Server_Cursor INTO @tmp;
-		END;
-	CLOSE Server_Cursor;
-	DEALLOCATE Server_Cursor;
-END
-`
-
-func TestSprocWithCursorNoResult(t *testing.T) {
-	conn, logger := open(t)
-	defer conn.Close()
-	defer logger.StopLogging()
-
-	_, e := conn.Exec(DropSprocWithCursor)
-	if e != nil {
-		t.Fatalf("Unable to drop test sproc: %v", e)
-	}
-	_, e = conn.Exec(CreateSprocWithCursor)
-	if e != nil {
-		t.Fatalf("Unable to create test sproc: %v", e)
-	}
-	defer conn.Exec(DropSprocWithCursor)
-	latency, _ := getLatency(t)
-	ctx, cancel := context.WithTimeout(context.Background(), latency+500*time.Millisecond)
-	defer cancel()
-	retmsg := &sqlexp.ReturnMessage{}
-	// Use a sproc instead of the cursor loop directly to cover the different code path in token.go
-	r, err := conn.QueryContext(ctx, `exec [dbo].[TestSqlCmd]`, retmsg)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	defer r.Close()
-	active := true
-	rsCount := 0
-	msgCount := 0
-	for active {
-		msg := retmsg.Message(ctx)
-		t.Logf("Got a message: %v", reflect.TypeOf(msg))
-		switch m := msg.(type) {
-		case sqlexp.MsgNext:
-			t.Fatalf("Got a MsgNext from a query with no rows")
-		case sqlexp.MsgError:
-			t.Fatalf("Got an error: %s", m.Error.Error())
-		case sqlexp.MsgNotice:
-			msgCount++
-		case sqlexp.MsgNextResultSet:
-			if active = r.NextResultSet(); active {
-				rsCount++
-			}
-		}
-	}
-	if r.Err() != nil {
-		t.Fatalf("Got an error: %v", r.Err())
-	}
-	if rsCount != 13 {
-		t.Fatalf("Unexpected record set count: %v", rsCount)
-	}
-	if msgCount != 2 {
-		t.Fatalf("Unexpected message count: %v", msgCount)
-	}
-}
-
-func TestErrorAsLastResult(t *testing.T) {
-	conn, logger := open(t)
-	defer conn.Close()
-	defer logger.StopLogging()
-	latency, _ := getLatency(t)
-	ctx, cancel := context.WithTimeout(context.Background(), latency+5000*time.Millisecond)
-	defer cancel()
-	retmsg := &sqlexp.ReturnMessage{}
-	// Use a sproc instead of the cursor loop directly to cover the different code path in token.go
-	r, err := conn.QueryContext(ctx,
-		`
-		Print N'message'
-		select 1
-		raiserror(N'Error!', 16, 1)`,
-		retmsg)
-	if err != nil {
-		t.Fatal(err.Error())
-	}
-	defer r.Close()
-	active := true
-	d := 0
-	err = nil
-	for active {
-		msg := retmsg.Message(ctx)
-		t.Logf("Got a message: %s", reflect.TypeOf(msg))
-		switch m := msg.(type) {
-		case sqlexp.MsgNext:
-			if !r.Next() {
-				t.Fatalf("Next returned false")
-			}
-			r.Scan(&d)
-			if r.Next() {
-				t.Fatal("Second Next returned true")
-			}
-		case sqlexp.MsgError:
-			err = m.Error
-		case sqlexp.MsgNextResultSet:
-			active = r.NextResultSet()
-		}
-	}
-	if err == nil {
-		t.Fatal("Should have gotten an error message")
-	} else {
-		switch e := err.(type) {
-		case Error:
-			if e.Message != "Error!" || e.Class != 16 {
-				t.Fatalf("Got the wrong mssql error %v", e)
-			}
-		default:
-			t.Fatalf("Got an unexpected error %v", e)
-		}
-	}
-}
diff --git a/queries_test.go b/queries_test.go
index 864453d..2b1125d 100644
--- a/queries_test.go
+++ b/queries_test.go
@@ -16,7 +16,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/microsoft/go-mssqldb/msdsn"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 func driverWithProcess(t *testing.T, tl Logger) *Driver {
@@ -1589,10 +1589,10 @@ func TestColumnTypeIntrospection(t *testing.T) {
 		{"cast('abc' as varbinary(max))", "VARBINARY", reflect.TypeOf([]byte{}), true, 2147483645, false, 0, 0},
 		{"cast(1 as datetime)", "DATETIME", reflect.TypeOf(time.Time{}), false, 0, false, 0, 0},
 		{"cast(1 as smalldatetime)", "SMALLDATETIME", reflect.TypeOf(time.Time{}), false, 0, false, 0, 0},
-		{"cast(getdate() as datetime2(7))", "DATETIME2", reflect.TypeOf(time.Time{}), false, 0, true, 0, 7},
-		{"cast(getdate() as datetimeoffset(7))", "DATETIMEOFFSET", reflect.TypeOf(time.Time{}), false, 0, true, 0, 7},
+		{"cast(getdate() as datetime2(7))", "DATETIME2", reflect.TypeOf(time.Time{}), false, 0, false, 0, 0},
+		{"cast(getdate() as datetimeoffset(7))", "DATETIMEOFFSET", reflect.TypeOf(time.Time{}), false, 0, false, 0, 0},
 		{"cast(getdate() as date)", "DATE", reflect.TypeOf(time.Time{}), false, 0, false, 0, 0},
-		{"cast(getdate() as time)", "TIME", reflect.TypeOf(time.Time{}), false, 0, true, 0, 7},
+		{"cast(getdate() as time)", "TIME", reflect.TypeOf(time.Time{}), false, 0, false, 0, 0},
 		{"'abc'", "VARCHAR", reflect.TypeOf(""), true, 3, false, 0, 0},
 		{"cast('abc' as varchar(max))", "VARCHAR", reflect.TypeOf(""), true, 2147483645, false, 0, 0},
 		{"N'abc'", "NVARCHAR", reflect.TypeOf(""), true, 3, false, 0, 0},
diff --git a/tds_login_test.go b/tds_login_test.go
index 3bb11e5..f7c4cb7 100644
--- a/tds_login_test.go
+++ b/tds_login_test.go
@@ -11,7 +11,7 @@ import (
 	"sync/atomic"
 	"testing"
 
-	"github.com/microsoft/go-mssqldb/msdsn"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 type MockTransportDialer struct {
diff --git a/tds_test.go b/tds_test.go
index 6d765cd..7d9af0d 100644
--- a/tds_test.go
+++ b/tds_test.go
@@ -17,7 +17,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/microsoft/go-mssqldb/msdsn"
+	"github.com/denisenkom/go-mssqldb/msdsn"
 )
 
 type MockTransport struct {
diff --git a/tvp_example_test.go b/tvp_example_test.go
index 2f8ede5..c27f98e 100644
--- a/tvp_example_test.go
+++ b/tvp_example_test.go
@@ -8,7 +8,7 @@ import (
 	"fmt"
 	"log"
 
-	mssql "github.com/microsoft/go-mssqldb"
+	mssql "github.com/denisenkom/go-mssqldb"
 )
 
 // This example shows how to use tvp type