How to change the default connection to a server in Visual studio 2012 SQL Project? How to change the default connection to a server in Visual studio 2012 SQL Project? sql-server sql-server

How to change the default connection to a server in Visual studio 2012 SQL Project?


Check the properties of your database project. Under Debug tab, there's option "Target Connection String". Change that to the server and database you want to use.


To change default connection

  1. On the menu, choose Tools-> Options -> Database tools
  2. On the data connections enter the SQL server Instance name that you want to use
  3. Press OK

this is from http://xprog.blogspot.com/2012/08/visual-studio-2012-change-default-sql.html

To change connection on a file by file basis

This worked for me. I had a sql file with BuildAction=Build and it was missing the sql connection toolbar.

  1. in solution explorer, click on the sql file
  2. change its BuildAction to None
  3. open the file (if its already open, close and reopen)

now you will get the connection toolbar.

you will have to remember to change the build action back when you are done with your maintenance.


To change the default db In Solution Explorer, right click on your DB project, select PropertiesGo to Debug TabUnder 'Target Connection String' click EDITenter you sql server details and save.