How to change the default connection to a server in Visual studio 2012 SQL Project?
Solution 1
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.
Solution 2
To change default connection
- On the menu, choose Tools-> Options -> Database tools
- On the data connections enter the SQL server Instance name that you want to use
- 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.
- in solution explorer, click on the sql file
- change its BuildAction to None
- 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.
Solution 3
To change the default db In Solution Explorer, right click on your DB project, select Properties Go to Debug Tab Under 'Target Connection String' click EDIT enter you sql server details and save.
Comments
-
suresh2 about 4 years
In visual studio 2012 sqlproj, the default connection button always connect to the (localdb)\Projects by default. How do I change that? Every time I need to disconnect and connect again to change the server.