How can I change my default database in SQL Server without using MS SQL Server Management Studio?

后端 未结 11 1799
遥遥无期
遥遥无期 2020-11-30 17:48

I dropped a database from SQL Server, however it turns out that my login was set to use the dropped database as its default. I can connect to SQL Server Man

11条回答
  •  长情又很酷
    2020-11-30 18:39

    To do it the GUI way, you need to go edit your login. One of its properties is the default database used for that login. You can find the list of logins under the Logins node under the Security node. Then select your login and right-click and pick Properties. Change the default database and your life will be better!

    Note that someone with sysadmin privs needs to be able to login to do this or to run the query from the previous post.

提交回复
热议问题