Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the default database for a SQL Azure login

I would like to change the default database for a login to support software that can access SQL Azure but does not allow easy alteration of a connection string. It appears that SQL Azure defaults to the master database.

I've already considered:

  • Stored procedures. I can't find a stored procedure that does this (sp_defaultdb is not implemented in SQL Azure as far as I can tell)

  • Alter Login. ALTER LOGIN does not permit the DEFAULT_DATABASE option.

  • SSMS. SSMS doesn't seem to allow much user control through the interface for SQL Azure.

Ideas?

like image 351
Lorin H Avatar asked Jan 14 '12 00:01

Lorin H


People also ask

How do I change my login database?

Changing Database Administrator's Password (Windows)Go to Tools & Settings > Database Servers. Click the host name of a database server. Click Change Password. Enter the new password and click OK.

How do I change my Azure SQL database location?

In the Azure portal, search for resource mover. Then, under Services, select Azure Resource Mover. In Overview, click Get started. In Move resources > Source + destination, select the source subscription and region.


1 Answers

Connection String:

Server=tcp:[serverName].database.windows.net;Database=myDataBase;User ID=[LoginForDb]@[serverName];Password=myPassword;Trusted_Connection=False;Encrypt=True; 

You can change connect default database, when you write 'Database' property at connection string.

SSMS is connect to database box which is option->secont tab at conecct dialog.

like image 138
t_yamatoya Avatar answered Sep 19 '22 02:09

t_yamatoya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!