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.
In Change Database Connection, select the item, and then click OK. In Find all references to the Database Connection, select the database connection to change. In Replace With, select a database connection. To create a new database connection, click New Database Connection.
On the View menu, select Other Windows > Data Sources. In the Data Sources window, click Add New Data Source. The Data Source Configuration Wizard opens. Select Database on the Choose a Data Source Type page, and then select Next.
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
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With