How to Change the Default Database for a Login in SQL Server

To change the default database for the login to a different database:

USE [master]
GO
ALTER LOGIN [John] WITH DEFAULT_DATABASE = master
GO

change_default_database_for_login

To change the default database for a login using SQL Server Management Studio (SSMS):
Right click on a login, click 'Properties', and choose default database:

change_default_database_for_login_ssms

If the post helped you, please share it:
Pin It

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">