denisenkom / go-mssqldb

Microsoft SQL server driver written in go language
BSD 3-Clause "New" or "Revised" License
1.81k stars 493 forks source link

What is the behavior when no database is specified? #709

Closed msummers-nr closed 2 years ago

msummers-nr commented 2 years ago

I'm using a query to pull query plans across all databases in a SQL Server instance. When I run this in SQL Studio the query runs against all databases in the instance, however my Go program only returns query plans from msdb. My Go program's connection only supplies the host, port, username, and password. Is there a way via connection configuration to query across all databases or do I need to list the databases and then query them individually?

Thanks in advance.

kardianos commented 2 years ago

specify the database with "/instance?database=". See readme.