Cannot connect to On-Premises SQL Server Express Instance with go-mssqldb

Viewed 39

I have ported a ETL utility I wrote over from C# to Go that performs a reporting task. The C# app is able to connect to the SQL Express server just fine but the Go app is struggling to find the named instance of SQLEXPRESS.

I have used both versions:

server=<server>\<instance>;user id=<user>;password=<passw>;database=<database>;
sqlserver://<user>:<passw>@<server>/<instance>?database=<database>

...in various iterations when executing:

db, err := sql.Open("sqlserver", connString)
if err != nil {
    panic(err)
}

... and in both cases I get the the following error back:

no instance matching 'SQLEXPRESS' returned from host 'localhost'
0 Answers
Related