What is the connection string to connect to the primary database through SQL Server


This is possibly a stupid question, but I can't find an answer anywhere else.

I have a SQL database script to restore a number of databases. Via SQL Server 2008, I am able to execute the script by connecting to the 'master' system database.

I'm attempting to automate the execution of this script via a .NET application using OdbcConnection / OdbcCommand classes.

So I need to enter a connection string to be able to execute the script.

Problem is I can't find the connection string for the master database. Is there one?

I tried "DSN=master", but this didn't appear to work.

Thanks in advance

You have to setup a new ODBC Data source in the ODBC Data Source Administrator that has the master database selected. If you name the DSN "master" then the connection string would indeed be "DSN=master".