Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (12.7k points)

I would like to change the default database for 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?

1 Answer

0 votes
by (9.6k points)

You can do the following:

1. Make changes in the connection string

Server=tcp:hello7.database.windows.net,1433;Initial Catalog=helloworld;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

Change the database name in the string.

2. In SSMS, here is what you can do while login in. 

image

image

Related questions

Browse Categories

...