|
The Database Connection
The Default Connection SqlAssist will open a connection to a database for each SQL file you open in Visual Studio. That connection will dictate what information will be available in SqlAssist's intellisense and where the script that you are editing will be executed when you run it. By default, SqlAssist will try to connect to the "master" database on the local SQL Server.
You can change the default connection by going to the "SqlAssist -> Configuration -> Default Server Connection" dialog. Select a database here to make SqlAssist attempt to connect to that database each time an SQL file is opened.
Changing Databases / Servers SqlAssist provides a dockable toolbar with a database combobox showing the database that the current SQL file is connected to. You can use this combobox to select reconnect the current SQL file to another database on the same server. By default, pressing Ctrl+U will activate that combobox (note that you must press the down-arrow key once selected to drop the list down). You can re-map this keystroke to any other by going to Visual Studio's "Tools -> Options -> Keyboard" dialog and select the "SqlAssist.Connect.ChangeDatabase" command.
If you want to change the server you are connected to, you can execute the "SqlAssist.Connect.ChangeServer" command, which is mapped to Ctrl+Alt+U by default. A dialog with login options will be displayed. Select a server and a database to change your connection.
Open Additional Files on Current Connection As mentioned above, the first SQL file opened will connect to the database specified in the Default Server Connection configuration option. However, if you open a second SQL file (and if the first file is the active document in Visual Studio at the time), that file will be connected to the same connection as the first file. You will find that this is typically the behavior that you will want. However, you can turn this behavior off in the configuration options.
Associate a Specific SQL file with a Database It is possible to associate a specific SQL file with a particular database/server, so that each time that file is opened, it will be automatically connected to that database. For details on how to do this, the "Text Editor" documentation page, "Associate a Database with a Script File". |